Skip to content

Commit 9399370

Browse files
committed
Don't use invalid or IPv6 DNS servers when crafting DHCP DDNS Zones. Fixes pfsense#3015
1 parent 1407f6a commit 9399370

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

etc/inc/services.inc

+9
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,15 @@ EOD;
851851
continue;
852852
$primary = $zone['dns-servers'][0];
853853
$secondary = empty($zone['dns-servers'][1]) ? "" : $zone['dns-servers'][1];
854+
// Make sure we aren't using any invalid or IPv6 DNS servers.
855+
if (!is_ipaddrv4($primary)) {
856+
if (is_ipaddrv4($secondary)) {
857+
$primary = $secondary;
858+
$secondary = "";
859+
} else {
860+
continue;
861+
}
862+
}
854863
// We don't need to add zones multiple times.
855864
if (!in_array($zone['domain-name'], $added_zones)) {
856865
$dhcpdconf .= "zone {$zone['domain-name']} {\n";

0 commit comments

Comments
 (0)