From d5ba5b16c18cb98dca5bb49aac63274b181134ba Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 21 Sep 2011 16:11:37 -0400 Subject: Handle an IPv6 PTR SOA manual record. --- config/tinydns/tinydns.inc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'config/tinydns') diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc index f18a86a7..bf0cb4b8 100644 --- a/config/tinydns/tinydns.inc +++ b/config/tinydns/tinydns.inc @@ -728,7 +728,18 @@ function tinydns_get_rowline_data($recordip, $recordtype, $ttl, $hostname, $rdns /* Note that some of these are simplistic versions of TinyDNS record handling. Uber-users can always do "raw" entries... */ case "SOA": // .fqdn:ip:x:ttl:timestamp:lo - $record_data = ".{$hostname}::{$recordip}{$ttl_string}"; + if (intval($config['version']) <= 8) { + $record_data = ".{$hostname}::{$recordip}{$ttl_string}"; + } else { + if (is_ipaddrv6($hostname)) { + list($rip, $rmask) = explode("/", $hostname); + $rmask = empty($rmask) ? 128 : $rmask; + $ip6_arpa = tinydns_get_ip6_subnet_arpa($rip, $rmask); + $record_data = ".{$ip6_arpa[1]}::{$recordip}{$ttl_string}"; + } else { + $record_data = ".{$hostname}::{$recordip}{$ttl_string}"; + } + } break; case "NS": // &serious.panic.mil:1.8.248.6:a -- cgit v1.2.3