diff --git a/src/etc/inc/plugins.inc.d/dhcpd.inc b/src/etc/inc/plugins.inc.d/dhcpd.inc index 57485f6e2..abc5ab737 100644 --- a/src/etc/inc/plugins.inc.d/dhcpd.inc +++ b/src/etc/inc/plugins.inc.d/dhcpd.inc @@ -1107,7 +1107,7 @@ EOD; $dhcpdconf .= " option root-path \"{$sm['rootpath']}\";\n"; } - if (!empty($sm['gateway']) && ($sm['gateway'] != $dhcpifconf['gateway'])) { + if (!empty($sm['gateway']) && $sm['gateway'] != "none" && ($sm['gateway'] != $dhcpifconf['gateway'])) { $dhcpdconf .= " option routers {$sm['gateway']};\n"; } diff --git a/src/www/services_dhcp_edit.php b/src/www/services_dhcp_edit.php index d4a7a2228..63df46fd7 100644 --- a/src/www/services_dhcp_edit.php +++ b/src/www/services_dhcp_edit.php @@ -164,7 +164,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } } - if (!empty($pconfig['gateway']) && !is_ipaddrv4($pconfig['gateway'])) { + if (!empty($pconfig['gateway']) && $pconfig['gateway'] != "none" && !is_ipaddrv4($pconfig['gateway'])) { $input_errors[] = gettext("A valid IP address must be specified for the gateway."); } @@ -173,7 +173,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary WINS servers."); } - if (is_subnetv4($parent_net) && !empty($pconfig['gateway'])) { + if (is_subnetv4($parent_net) && $pconfig['gateway'] != "none" && !empty($pconfig['gateway'])) { if (!ip_in_subnet($pconfig['gateway'], $parent_net) && !ip_in_interface_alias_subnet($if, $pconfig['gateway'])) { $input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']); } @@ -420,7 +420,9 @@ include("head.inc");