mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 08:34:39 +00:00
Services / DHCPv4 - static entries: add "none" option to gateway setting. Although I really don't like how "none" is a valid option, it will be more consistent with the overal experience. closes https://github.com/opnsense/core/issues/4843
This commit is contained in:
parent
e16d889691
commit
b2f6cf581f
@ -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";
|
||||
}
|
||||
|
||||
|
||||
@ -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");
|
||||
<td>
|
||||
<input name="gateway" type="text" value="<?=$pconfig['gateway'];?>" />
|
||||
<div class="hidden" data-for="help_for_gateway">
|
||||
<?=gettext("The default is to use the IP on this interface of the firewall as the gateway. Specify an alternate gateway here if this is not the correct gateway for your network.");?>
|
||||
<?=gettext('The default is to use the IP on this interface of the firewall as the gateway. '.
|
||||
'Specify an alternate gateway here if this is not the correct gateway for your network. ' .
|
||||
'Type "none" for no gateway assignment.');?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user