Commit 70f89cfc authored by Ad Schellevis's avatar Ad Schellevis

(legacy) use reverse mask instead of reverse address for ddns in dhcpd...

(legacy) use reverse mask instead of reverse address for ddns in dhcpd (https://github.com/opnsense/core/issues/352)
parent 38791228
...@@ -600,12 +600,12 @@ EOPP; ...@@ -600,12 +600,12 @@ EOPP;
} else { } else {
$newzone['domain-name'] = $config['system']['domain']; $newzone['domain-name'] = $config['system']['domain'];
} }
$revsubnet = explode(".", $subnet); $revsubnet = array_reverse(explode(".", $subnet));
$revsubnet = array_reverse($revsubnet); $subnetmask_rev = array_reverse(explode('.', $subnetmask));
foreach ($revsubnet as $octet) { foreach ($subnetmask_rev as $octet) {
if ($octet != "0") if ($octet == "0") {
break; array_shift($revsubnet);
array_shift($revsubnet); }
} }
$newzone['ptr-domain'] = implode(".", $revsubnet) . ".in-addr.arpa"; $newzone['ptr-domain'] = implode(".", $revsubnet) . ".in-addr.arpa";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment