diff options
author | jim-p <jimp@pfsense.org> | 2011-06-09 12:52:00 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-06-09 12:52:00 -0400 |
commit | 5f2d551d4a763a778865e5c5c10a01f100181f63 (patch) | |
tree | 37315792572b5065ad12ff33868461fadcbbbf4e /config/tinydns/tinydns.inc | |
parent | 7638901b02b1a6d708e6f027ecb6ecae21fa08f3 (diff) | |
download | pfsense-packages-5f2d551d4a763a778865e5c5c10a01f100181f63.tar.gz pfsense-packages-5f2d551d4a763a778865e5c5c10a01f100181f63.tar.bz2 pfsense-packages-5f2d551d4a763a778865e5c5c10a01f100181f63.zip |
Use the new ip6 arpa function where needed instead of the v4 version if it's a v6 ip.
Diffstat (limited to 'config/tinydns/tinydns.inc')
-rw-r--r-- | config/tinydns/tinydns.inc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc index 51ec13f7..102f6ebb 100644 --- a/config/tinydns/tinydns.inc +++ b/config/tinydns/tinydns.inc @@ -246,7 +246,11 @@ function tinydns_custom_php_changeip_command() { $ipmask = find_interface_subnet($dnscacheif); else $ipmask = $config['interfaces'][$dnsif]['subnet']; - $arr = tinydns_get_ip_subnet_arpa($dnscacheip, $ipmask); + + if (is_ipaddr($ipaddress)) + $arr = tinydns_get_ip_subnet_arpa($ipaddress, $ipmask); + elseif (intval($config['version']) >= 6) + $arr = tinydns_get_ip6_subnet_arpa($ipaddress, $ipmask); $dnsuserip = $arr[0]; //exec("/bin/mkdir -p {$g['varetc_path']}/dnscache{$dnsidx}"); exec("/usr/local/bin/dnscache-conf Gdnscache Gdnslog {$g['varetc_path']}/dnscache{$dnsidx} {$dnscacheip}"); @@ -891,7 +895,10 @@ function tinydns_get_ip6_subnet_arpa($ip, $ipmask=128) { /* Create a Forward and a Reverse DNS (SOA, A, PTR) records for Fully Qualififed Domain Name*/ function tinydns_complete_soa_record($fd, $ip, $ipmask, $nsname, $domain) { $fqdn = "{$nsname}.{$domain}"; - $rip = tinydns_get_ip_subnet_arpa($ip, $ipmask); + if (is_ipaddr($ipaddress)) + $rip = tinydns_get_ip_subnet_arpa($ipaddress, $ipmask); + elseif (intval($config['version']) >= 6) + $rip = tinydns_get_ip6_subnet_arpa($ipaddress, $ipmask); $soa = ".{$domain}::{$fqdn}"; $rsoa = ".{$rip[1]}::{$fqdn}"; $a = "={$fqdn}:{$ip}"; |