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,13 +600,13 @@ EOPP;
} else {
$newzone['domain-name'] = $config['system']['domain'];
}
$revsubnet = explode(".", $subnet);
$revsubnet = array_reverse($revsubnet);
foreach ($revsubnet as $octet) {
if ($octet != "0")
break;
$revsubnet = array_reverse(explode(".", $subnet));
$subnetmask_rev = array_reverse(explode('.', $subnetmask));
foreach ($subnetmask_rev as $octet) {
if ($octet == "0") {
array_shift($revsubnet);
}
}
$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