diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 4dce7d7fed..b55f278d38 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -1272,6 +1272,7 @@ function configure_cron() { } function upnp_action ($action) { + global $g, $config; switch($action) { case "start": if (file_exists('/var/etc/miniupnpd.conf')) { diff --git a/etc/rc.initial.firmware_update b/etc/rc.initial.firmware_update index 8d16098869..f4363c6497 100755 --- a/etc/rc.initial.firmware_update +++ b/etc/rc.initial.firmware_update @@ -93,7 +93,7 @@ switch ($command) { exec("fetch -1 -w15 -a -v -o /root/firmware.tgz.md5 \"$url.md5\""); } else { echo "\n\nWARNING.\n"; - echo "\nCould not locate a MD5 file. We cannot verify the download once its done.\n\n"; + echo "\nCould not locate a MD5 file. We cannot verify the download once completed.\n\n"; sleep(15); } if(file_exists("/root/firmware.tgz.md5")) { diff --git a/etc/rc.stop_packages b/etc/rc.stop_packages old mode 100644 new mode 100755 diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 97493bf78a..a100065e98 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -302,6 +302,26 @@ if ($_POST) { $input_errors[] = sprintf(gettext("%s is not a valid start destination port. It must be a port alias or integer between 1 and 65535."),$_POST['dstbeginport']); if ($_POST['dstendport'] && !is_portoralias($_POST['dstendport'])) $input_errors[] = sprintf(gettext("%s is not a valid end destination port. It must be a port alias or integer between 1 and 65535."),$_POST['dstendport']); + if ( !$_POST['srcbeginport_cust'] && $_POST['srcendport_cust']) + if (is_alias($_POST['srcendport_cust'])) + $input_errors[] = 'If you put port alias in Source port range to: field you must put the same port alias in from: field'; + if ( $_POST['srcbeginport_cust'] && $_POST['srcendport_cust']){ + if (is_alias($_POST['srcendport_cust']) && is_alias($_POST['srcendport_cust']) && $_POST['srcbeginport_cust'] != $_POST['srcendport_cust']) + $input_errors[] = 'The same port alias must be used in Source port range from: and to: fields'; + if ((is_alias($_POST['srcbeginport_cust']) && (!is_alias($_POST['srcendport_cust']) && $_POST['srcendport_cust']!='')) || + ((!is_alias($_POST['srcbeginport_cust']) && $_POST['srcbeginport_cust']!='') && is_alias($_POST['srcendport_cust']))) + $input_errors[] = 'You cannot specify numbers and port aliases at the same time in Source port range from: and to: field'; + } + if ( !$_POST['dstbeginport_cust'] && $_POST['dstendport_cust']) + if (is_alias($_POST['dstendport_cust'])) + $input_errors[] = 'If you put port alias in Destination port range to: field you must put the same port alias in from: field'; + if ( $_POST['dstbeginport_cust'] && $_POST['dstendport_cust']){ + if (is_alias($_POST['dstendport_cust']) && is_alias($_POST['dstendport_cust']) && $_POST['dstbeginport_cust'] != $_POST['dstendport_cust']) + $input_errors[] = 'The same port alias must be used in Destination port range from: and to: fields'; + if ((is_alias($_POST['dstbeginport_cust']) && (!is_alias($_POST['dstendport_cust']) && $_POST['dstendport_cust']!='')) || + ((!is_alias($_POST['dstbeginport_cust']) && $_POST['dstbeginport_cust']!='') && is_alias($_POST['dstendport_cust']))) + $input_errors[] = 'You cannot specify numbers and port aliases at the same time in Destination port range from: and to: field'; + } /* if user enters an alias and selects "network" then disallow. */ if($_POST['srctype'] == "network") { diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index d02fef6fb3..17fbb8085f 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -216,6 +216,12 @@ if ($_POST) { $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']))) $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']) { + $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']))) $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers."); diff --git a/usr/local/www/services_dhcp_relay.php b/usr/local/www/services_dhcp_relay.php index 37a983780f..d0f11084a2 100755 --- a/usr/local/www/services_dhcp_relay.php +++ b/usr/local/www/services_dhcp_relay.php @@ -180,7 +180,7 @@ function enable_change(enable_over) {
- + diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml index 401be3e821..08870e126e 100644 --- a/usr/local/www/wizards/setup_wizard.xml +++ b/usr/local/www/wizards/setup_wizard.xml @@ -590,6 +590,8 @@ } unset($config['wizardtemp']); write_config(); + interface_reconfigure("wan"); + interface_reconfigure("lan"); reload_all(); mwexec_bg("/etc/rc.update_bogons.sh now"); ]]>