Commit 1e3a4c39 authored by Franco Fichtner's avatar Franco Fichtner

radvd: fix two regressions from 16.7.9

o Mark interface used in case of interface tracking
o Don't inject local DNS server when there is no IP

PR: https://github.com/opnsense/core/issues/1273
(cherry picked from commit 0ec85692)
parent b85b6c63
...@@ -132,7 +132,7 @@ function services_radvd_configure($blacklist = array()) ...@@ -132,7 +132,7 @@ function services_radvd_configure($blacklist = array())
$ifcfgsnv6 = get_interface_subnetv6($dhcpv6if); $ifcfgsnv6 = get_interface_subnetv6($dhcpv6if);
$subnetv6 = gen_subnetv6($ifcfgipv6, $ifcfgsnv6); $subnetv6 = gen_subnetv6($ifcfgipv6, $ifcfgsnv6);
$radvdifs[$realif] = $realif; $radvdifs[$realif] = 1;
$radvdconf .= "# Generated for DHCPv6 Server $dhcpv6if\n"; $radvdconf .= "# Generated for DHCPv6 Server $dhcpv6if\n";
$radvdconf .= "interface {$realif} {\n"; $radvdconf .= "interface {$realif} {\n";
...@@ -239,16 +239,30 @@ function services_radvd_configure($blacklist = array()) ...@@ -239,16 +239,30 @@ function services_radvd_configure($blacklist = array())
if (isset($radvdifs[$realif])) { if (isset($radvdifs[$realif])) {
continue; continue;
} }
$radvdifs[$realif] = 1;
$dnslist = array();
$ifcfgipv6 = get_interface_ipv6($if); $ifcfgipv6 = get_interface_ipv6($if);
if (!is_ipaddrv6($ifcfgipv6)) { if (!is_ipaddrv6($ifcfgipv6)) {
$subnetv6 = "::"; $subnetv6 = "::";
$ifcfgsnv6 = "64"; $ifcfgsnv6 = "64";
} else { } else {
if (isset($config['dnsmasq']['enable']) || isset($config['unbound']['enable'])) {
$dnslist[] = $ifcfgipv6;
}
$ifcfgsnv6 = get_interface_subnetv6($if); $ifcfgsnv6 = get_interface_subnetv6($if);
$subnetv6 = gen_subnetv6($ifcfgipv6, $ifcfgsnv6); $subnetv6 = gen_subnetv6($ifcfgipv6, $ifcfgsnv6);
} }
if (!empty($config['system']['dnsserver'])) {
foreach($config['system']['dnsserver'] as $server) {
if (is_ipaddrv6($server)) {
$dnslist[] = $server;
}
}
}
if (isset($config['interfaces'][$trackif]['ipaddrv6'])) { if (isset($config['interfaces'][$trackif]['ipaddrv6'])) {
$autotype = $config['interfaces'][$trackif]['ipaddrv6']; $autotype = $config['interfaces'][$trackif]['ipaddrv6'];
$radvdconf .= "# Generated config for {$autotype} delegation from {$trackif} on {$if}\n"; $radvdconf .= "# Generated config for {$autotype} delegation from {$trackif} on {$if}\n";
...@@ -267,17 +281,6 @@ function services_radvd_configure($blacklist = array()) ...@@ -267,17 +281,6 @@ function services_radvd_configure($blacklist = array())
$radvdconf .= "\t\tAdvRouterAddr on;\n"; $radvdconf .= "\t\tAdvRouterAddr on;\n";
$radvdconf .= "\t};\n"; $radvdconf .= "\t};\n";
/* add DNS servers */
$dnslist = array();
if (isset($config['dnsmasq']['enable']) || isset($config['unbound']['enable'])) {
$dnslist[] = $ifcfgipv6;
} elseif (!empty($config['system']['dnsserver'])) {
foreach($config['system']['dnsserver'] as $server) {
if (is_ipaddrv6($server)) {
$dnslist[] = $server;
}
}
}
if (count($dnslist) > 0) { if (count($dnslist) > 0) {
$radvdconf .= "\tRDNSS ".implode(" ", $dnslist)." { };\n"; $radvdconf .= "\tRDNSS ".implode(" ", $dnslist)." { };\n";
} }
......
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