Fix #7493 only check interface IP if static

(cherry picked from commit 8c6190e82f)
This commit is contained in:
Phil Davis 2017-04-25 08:30:30 +05:45 committed by Renato Botelho
parent 1ed363656f
commit 039f3db577

View File

@ -720,7 +720,7 @@ if ($_POST['apply']) {
/* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
$staticroutes = get_staticroutes(true);
$_POST['spoofmac'] = strtolower(str_replace("-", ":", $_POST['spoofmac']));
if ($_POST['ipaddr']) {
if (($_POST['type'] == 'staticv4') && $_POST['ipaddr']) {
if (!is_ipaddrv4($_POST['ipaddr'])) {
$input_errors[] = gettext("A valid IPv4 address must be specified.");
} else {
@ -752,7 +752,7 @@ if ($_POST['apply']) {
}
}
}
if ($_POST['ipaddrv6']) {
if (($_POST['type'] == 'staticv6') && $_POST['ipaddrv6']) {
$_POST['ipaddrv6'] = addrtolower($_POST['ipaddrv6']);
if (!is_ipaddrv6($_POST['ipaddrv6'])) {