summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2012-03-13 12:05:10 +1100
committerAmitay Isaacs <amitay@gmail.com>2012-03-21 11:41:50 +1100
commitffce812c22932704618bee212f07f43907e78083 (patch)
tree1cbe6a960ea35c49dc3ab417450ede51196bab07
parent8a39c5c3a1cd3868a5829da21bf87e2b370dd4cc (diff)
downloadsamba-ffce812c22932704618bee212f07f43907e78083.tar.gz
samba-ffce812c22932704618bee212f07f43907e78083.tar.bz2
samba-ffce812c22932704618bee212f07f43907e78083.zip
s4-rpc: dnsserver: Fix IPv6 reverse zone handling
Thanks to Marcel Ritter <marcel.ritter@rrze.fau.de> for the patch.
-rw-r--r--source4/rpc_server/dnsserver/dnsutils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/rpc_server/dnsserver/dnsutils.c b/source4/rpc_server/dnsserver/dnsutils.c
index 52a8bdde29..8140296186 100644
--- a/source4/rpc_server/dnsserver/dnsutils.c
+++ b/source4/rpc_server/dnsserver/dnsutils.c
@@ -159,6 +159,7 @@ struct dnsserver_zoneinfo *dnsserver_init_zoneinfo(struct dnsserver_zone *zone,
struct dnsserver_zoneinfo *zoneinfo;
uint32_t fReverse;
const char *revzone = "in-addr.arpa";
+ const char *revzone6 = "ip6.arpa";
int len1, len2;
zoneinfo = talloc_zero(zone, struct dnsserver_zoneinfo);
@@ -167,11 +168,17 @@ struct dnsserver_zoneinfo *dnsserver_init_zoneinfo(struct dnsserver_zone *zone,
}
/* If the zone name ends with in-addr.arpa, it's reverse zone */
+ /* If the zone name ends with ip6.arpa, it's reverse zone (IPv6) */
fReverse = 0;
len1 = strlen(zone->name);
len2 = strlen(revzone);
if (len1 > len2 && strcasecmp(&zone->name[len1-len2], revzone) == 0) {
fReverse = 1;
+ } else {
+ len2 = strlen(revzone6);
+ if (len1 > len2 && strcasecmp(&zone->name[len1-len2], revzone6) == 0) {
+ fReverse = 1;
+ }
}
zoneinfo->Version = 0x32;