summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_dhcp.php
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www/services_dhcp.php')
-rwxr-xr-xusr/local/www/services_dhcp.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php
index 17fbb80..122912d 100755
--- a/usr/local/www/services_dhcp.php
+++ b/usr/local/www/services_dhcp.php
@@ -116,8 +116,8 @@ $iflist = get_configured_interface_with_descr();
if (!$if || !isset($iflist[$if])) {
foreach ($iflist as $ifent => $ifname) {
$oc = $config['interfaces'][$ifent];
- if ((is_array($config['dhcpd'][$ifent]) && !isset($config['dhcpd'][$ifent]['enable']) && (!is_ipaddr($oc['ipaddr']))) ||
- (!is_array($config['dhcpd'][$ifent]) && (!is_ipaddr($oc['ipaddr']))))
+ if ((is_array($config['dhcpd'][$ifent]) && !isset($config['dhcpd'][$ifent]['enable']) && (!is_ipaddrv4($oc['ipaddr']))) ||
+ (!is_array($config['dhcpd'][$ifent]) && (!is_ipaddrv4($oc['ipaddr']))))
continue;
$if = $ifent;
break;
@@ -208,21 +208,21 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
- if (($_POST['range_from'] && !is_ipaddr($_POST['range_from'])))
+ if (($_POST['range_from'] && !is_ipaddrv4($_POST['range_from'])))
$input_errors[] = gettext("A valid range must be specified.");
- if (($_POST['range_to'] && !is_ipaddr($_POST['range_to'])))
+ if (($_POST['range_to'] && !is_ipaddrv4($_POST['range_to'])))
$input_errors[] = gettext("A valid range must be specified.");
- if (($_POST['gateway'] && !is_ipaddr($_POST['gateway'])))
+ if (($_POST['gateway'] && !is_ipaddrv4($_POST['gateway'])))
$input_errors[] = gettext("A valid IP address must be specified for the gateway.");
- if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2'])))
+ if (($_POST['wins1'] && !is_ipaddrv4($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddrv4($_POST['wins2'])))
$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary WINS servers.");
$parent_ip = get_interface_ip($_POST['if']);
- if (is_ipaddr($parent_ip) && $_POST['gateway']) {
+ if (is_ipaddrv4($parent_ip) && $_POST['gateway']) {
$parent_sn = get_interface_subnet($_POST['if']);
if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway']))
$input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
}
- if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2'])))
+ if (($_POST['dns1'] && !is_ipaddrv4($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv4($_POST['dns2'])))
$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers.");
if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60)))
@@ -231,13 +231,13 @@ if ($_POST) {
$input_errors[] = gettext("The maximum lease time must be at least 60 seconds and higher than the default lease time.");
if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain'])))
$input_errors[] = gettext("A valid domain name must be specified for the dynamic DNS registration.");
- if (($_POST['ntp1'] && !is_ipaddr($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddr($_POST['ntp2'])))
+ if (($_POST['ntp1'] && !is_ipaddrv4($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddrv4($_POST['ntp2'])))
$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary NTP servers.");
if (($_POST['domain'] && !is_domain($_POST['domain'])))
$input_errors[] = gettext("A valid domain name must be specified for the DNS domain.");
- if ($_POST['tftp'] && !is_ipaddr($_POST['tftp']) && !is_domain($_POST['tftp']) && !is_URL($_POST['tftp']))
+ if ($_POST['tftp'] && !is_ipaddrv4($_POST['tftp']) && !is_domain($_POST['tftp']) && !is_URL($_POST['tftp']))
$input_errors[] = gettext("A valid IP address or hostname must be specified for the TFTP server.");
- if (($_POST['nextserver'] && !is_ipaddr($_POST['nextserver'])))
+ if (($_POST['nextserver'] && !is_ipaddrv4($_POST['nextserver'])))
$input_errors[] = gettext("A valid IP address must be specified for the network boot server.");
if(gen_subnet($ifcfgip, $ifcfgsn) == $_POST['range_from'])
@@ -282,7 +282,7 @@ if ($_POST) {
$input_errors[] = gettext("Signed 16-bit integer type must be a number in the range -32768 to 32767.");
else if ( $numberoption['type'] == 'signed integer 32' && (!is_numeric($numberoption['value']) || $numberoption['value'] < -2147483648 || $numberoption['value'] > 2147483647) )
$input_errors[] = gettext("Signed 32-bit integer type must be a number in the range -2147483648 to 2147483647.");
- else if ( $numberoption['type'] == 'ip-address' && !is_ipaddr($numberoption['value']) && !is_hostname($numberoption['value']) )
+ else if ( $numberoption['type'] == 'ip-address' && !is_ipaddrv4($numberoption['value']) && !is_hostname($numberoption['value']) )
$input_errors[] = gettext("IP address or host type must be an IP address or host name.");
}
}
@@ -544,8 +544,8 @@ include("head.inc");
$i = 0;
foreach ($iflist as $ifent => $ifname) {
$oc = $config['interfaces'][$ifent];
- if ((is_array($config['dhcpd'][$ifent]) && !isset($config['dhcpd'][$ifent]['enable']) && (!is_ipaddr($oc['ipaddr']))) ||
- (!is_array($config['dhcpd'][$ifent]) && (!is_ipaddr($oc['ipaddr']))))
+ if ((is_array($config['dhcpd'][$ifent]) && !isset($config['dhcpd'][$ifent]['enable']) && (!is_ipaddrv4($oc['ipaddr']))) ||
+ (!is_array($config['dhcpd'][$ifent]) && (!is_ipaddrv4($oc['ipaddr']))))
continue;
if ($ifent == $if)
$active = true;
OpenPOWER on IntegriCloud