summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/gwlb.inc60
-rw-r--r--etc/inc/pfsense-utils.inc11
-rw-r--r--etc/inc/service-utils.inc3
-rw-r--r--etc/inc/services.inc33
-rw-r--r--etc/inc/system.inc14
-rwxr-xr-xetc/rc12
-rw-r--r--etc/skel/dot.tcshrc2
-rw-r--r--root/.tcshrc2
-rw-r--r--usr/local/www/diag_dns.php2
-rwxr-xr-xusr/local/www/diag_ping.php2
-rw-r--r--usr/local/www/diag_testport.php2
-rwxr-xr-xusr/local/www/diag_traceroute.php2
-rwxr-xr-xusr/local/www/firewall_rules_edit.php181
-rw-r--r--usr/local/www/interfaces_bridge_edit.php4
-rw-r--r--usr/local/www/interfaces_gif_edit.php2
-rwxr-xr-xusr/local/www/services_dnsmasq.php64
-rw-r--r--usr/local/www/wizards/setup_wizard.xml14
-rwxr-xr-xusr/local/www/wizards/traffic_shaper_wizard_dedicated.inc1
-rwxr-xr-xusr/local/www/wizards/traffic_shaper_wizard_multi_all.inc1
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc1
20 files changed, 245 insertions, 168 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 50eabc1..088f251 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -368,58 +368,26 @@ function return_gateways_array($disabled = false, $localhost = false) {
continue;
/* if the gateway is dynamic and we can find the IPv4, Great! */
- if (empty($gateway['gateway']) || $gateway['gateway'] == "dynamic") {
+ if (empty($gateway['gateway']) || $gateway['gateway'] == "dynamic" || $gateway['gateway'] == "dynamic6") {
if ($gateway['ipprotocol'] == "inet") {
/* we know which interfaces is dynamic, this should be made a function */
- switch($wancfg['ipaddr']) {
- case "dhcp":
- case "pppoe":
- case "pptp":
- case "ppp":
- $gateway['ipprotocol'] = "inet";
- $gateway['gateway'] = get_interface_gateway($gateway['interface']);
- /* no IP address found, set to dynamic */
- if (!is_ipaddrv4($gateway['gateway']))
- $gateway['gateway'] = "dynamic";
- $gateway['dynamic'] = true;
- break;
- default:
- $gateway['ipprotocol'] = "inet";
- $gateway['gateway'] = get_interface_gateway($gateway['interface']);
- /* no IP address found, set to dynamic */
- if (!is_ipaddrv4($gateway['gateway']))
- $gateway['gateway'] = "dynamic";
- $gateway['dynamic'] = true;
- break;
- }
+ $gateway['ipprotocol'] = "inet";
+ $gateway['gateway'] = get_interface_gateway($gateway['interface']);
+ /* no IP address found, set to dynamic */
+ if (!is_ipaddrv4($gateway['gateway']))
+ $gateway['gateway'] = "dynamic";
+ $gateway['dynamic'] = true;
}
/* if the gateway is dynamic6 and we can find the IPv6, Great! */
- if ($gateway['ipprotocol'] == "inet6") {
+ else if ($gateway['ipprotocol'] == "inet6") {
/* we know which interfaces is dynamic, this should be made a function, and for v6 too */
- switch($wancfg['ipaddrv6']) {
- case "6rd":
- case "6to4":
- case "dhcp6":
- case "pppoe":
- case "pptp":
- case "ppp":
- $gateway['ipprotocol'] = "inet6";
- $gateway['gateway'] = get_interface_gateway_v6($gateway['interface']);
- /* no IPv6 address found, set to dynamic6 */
- if (!is_ipaddrv6($gateway['gateway']))
- $gateway['gateway'] = "dynamic6";
- $gateway['dynamic'] = true;
- break;
- default:
- $gateway['ipprotocol'] = "inet6";
- $gateway['gateway'] = get_interface_gateway_v6($gateway['interface']);
- /* no IPv6 address found, set to dynamic6 */
- if (!is_ipaddrv6($gateway['gateway']))
- $gateway['gateway'] = "dynamic6";
- $gateway['dynamic'] = true;
- break;
- }
+ $gateway['ipprotocol'] = "inet6";
+ $gateway['gateway'] = get_interface_gateway_v6($gateway['interface']);
+ /* no IPv6 address found, set to dynamic6 */
+ if (!is_ipaddrv6($gateway['gateway']))
+ $gateway['gateway'] = "dynamic6";
+ $gateway['dynamic'] = true;
}
} else {
/* getting this detection right is hard at this point because we still don't
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 7c53885..11bc42d 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1598,11 +1598,12 @@ function load_thermal_hardware() {
******/
function isvm() {
$virtualenvs = array("vmware", "parallels", "qemu", "bochs", "plex86");
- $bios_vendor = strtolower(`/bin/kenv | /usr/bin/awk -F= '/smbios.bios.vendor/ {print $2}'`);
- if(in_array($bios_vendor, $virtualenvs))
- return true;
- else
- return false;
+ $bios_product = trim(`/bin/kenv | /usr/bin/awk -F= '/smbios.system.product/ {print $2}'`);
+ foreach ($virtualenvs as $virtualenv)
+ if (stripos($bios_product, $virtualenv) !== false)
+ return true;
+
+ return false;
}
function get_freebsd_version() {
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc
index f920252..af90809 100644
--- a/etc/inc/service-utils.inc
+++ b/etc/inc/service-utils.inc
@@ -414,6 +414,9 @@ function get_service_status($service) {
if (isset($config['captiveportal'][$service['zone']]['httpslogin']))
$running = $running && is_pid_running("{$g['varrun_path']}/lighty-{$service['zone']}-CaptivePortal-SSL.pid");
break;
+ case "vhosts-http":
+ $running = is_pid_running("{$g['varrun_path']}/vhosts-http.pid");
+ break;
default:
$running = is_service_running($service['name']);
}
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 8b8a6ff..1458e1c 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -1573,6 +1573,35 @@ function services_dnsmasq_configure() {
$args .= " --dhcp-hostsfile={$g['varetc_path']}/hosts ";
}
+ /* Setup listen port, if non-default */
+ if (is_port($config['dnsmasq']['port']))
+ $args .= " --port={$config['dnsmasq']['port']} ";
+
+ $listen_addresses = "";
+ if(isset($config['dnsmasq']['interface'])) {
+ $interfaces = explode(",", $config['dnsmasq']['interface']);
+ foreach ($interfaces as $interface) {
+ if (is_ipaddr($interface)) {
+ $listen_addresses .= " --listen-address={$interface} ";
+ } else {
+ $if = get_real_interface($interface);
+ if (does_interface_exist($if)) {
+ $laddr = find_interface_ip($if);
+ if (is_ipaddrv4($laddr))
+ $listen_addresses .= " --listen-address={$laddr} ";
+ $laddr6 = find_interface_ipv6($if);
+ if (is_ipaddrv6($laddr6) && !isset($config['dnsmasq']['strictbind']))
+ $listen_addresses .= " --listen-address={$laddr6} ";
+ }
+ }
+ }
+ if (!empty($listen_addresses)) {
+ $args .= " {$listen_addresses} ";
+ if (isset($config['dnsmasq']['strictbind']))
+ $args .= " --bind-interfaces ";
+ }
+ }
+
/* Setup forwarded domains */
if (isset($config['dnsmasq']['domainoverrides']) && is_array($config['dnsmasq']['domainoverrides'])) {
foreach($config['dnsmasq']['domainoverrides'] as $override) {
@@ -1621,7 +1650,9 @@ function services_dnsmasq_configure() {
}
/* run dnsmasq */
- mwexec_bg("/usr/local/sbin/dnsmasq --local-ttl 1 --all-servers {$dns_rebind} --dns-forward-max=5000 --cache-size=10000 {$args}");
+ $cmd = "/usr/local/sbin/dnsmasq --local-ttl 1 --all-servers {$dns_rebind} --dns-forward-max=5000 --cache-size=10000 {$args}";
+ //log_error("dnsmasq command: {$cmd}");
+ mwexec_bg($cmd);
unset($args);
if ($g['booting'])
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 58793eb..f1cb84c 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -1595,7 +1595,7 @@ function system_get_dmesg_boot() {
return file_get_contents("{$g['varlog_path']}/dmesg.boot");
}
-function get_possible_listen_ips() {
+function get_possible_listen_ips($include_ipv6_link_local=false) {
$interfaces = get_configured_interface_with_descr();
$carplist = get_configured_carp_interface_list();
$listenips = array();
@@ -1608,6 +1608,14 @@ function get_possible_listen_ips() {
$tmp["name"] = $ifacename;
$tmp["value"] = $iface;
$listenips[] = $tmp;
+ if ($include_ipv6_link_local) {
+ $llip = find_interface_ipv6_ll(get_real_interface($iface));
+ if (!empty($llip)) {
+ $tmp["name"] = "{$ifacename} IPv6 Link-Local";
+ $tmp["value"] = $llip;
+ $listenips[] = $tmp;
+ }
+ }
}
$tmp["name"] = "Localhost";
$tmp["value"] = "lo0";
@@ -1615,9 +1623,9 @@ function get_possible_listen_ips() {
return $listenips;
}
-function get_possible_traffic_source_addresses() {
+function get_possible_traffic_source_addresses($include_ipv6_link_local=false) {
global $config;
- $sourceips = get_possible_listen_ips();
+ $sourceips = get_possible_listen_ips($include_ipv6_link_local);
foreach (array('server', 'client') as $mode) {
if (is_array($config['openvpn']["openvpn-{$mode}"])) {
foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) {
diff --git a/etc/rc b/etc/rc
index e2c3847..c4885a5 100755
--- a/etc/rc
+++ b/etc/rc
@@ -33,9 +33,9 @@ fi
if [ -e /root/force_fsck ]; then
echo "Forcing filesystem check..."
- /sbin/fsck -fy -t ufs /
+ /sbin/fsck -y -t ufs /
if [ "$PLATFORM" = "nanobsd" ]; then
- /sbin/fsck -fy -t ufs /cf
+ /sbin/fsck -y -t ufs /cf
fi
fi
@@ -81,9 +81,9 @@ else
# Mount /. If it fails run a fsck.
if [ "$PLATFORM" = "nanobsd" ]; then
export PKG_TMPDIR=/root/
- /sbin/mount -uw / || (/sbin/fsck -fy; /sbin/mount -uw /)
+ /sbin/mount -uw / || (/sbin/fsck -y /; /sbin/fsck -y /cf; /sbin/mount -uw /)
else
- /sbin/mount -a || (/sbin/fsck -fy; /sbin/mount -a)
+ /sbin/mount -a || (/sbin/fsck -y /; /sbin/mount -a)
fi
# If /conf is a directory, convert it to a symlink to /cf/conf
@@ -98,11 +98,11 @@ else
if [ ! "$PLATFORM" = "jail" ]; then
# Check to see if a compact flash mountpoint exists
- # If it fails to mount then run a fsck -fy
+ # If it fails to mount then run a fsck -y
if grep -q cf /etc/fstab; then
/sbin/mount -w /cf 2>/dev/null
/sbin/mount -uw /cf || \
- (/sbin/umount /cf; /sbin/fsck -fy /cf; /sbin/mount -w /cf)
+ (/sbin/umount /cf; /sbin/fsck -y /cf; /sbin/mount -w /cf)
fi
fi
diff --git a/etc/skel/dot.tcshrc b/etc/skel/dot.tcshrc
index 64e5ca4..cd20f2d 100644
--- a/etc/skel/dot.tcshrc
+++ b/etc/skel/dot.tcshrc
@@ -18,4 +18,4 @@ if ($term == "xterm" || $term == "vt100" || $term == "vt102" || $term == "vt220"
bindkey "\e[7~" beginning-of-line # Home rxvt/konsole
bindkey "\e[8~" end-of-line # End rxvt/konsole
-endif \ No newline at end of file
+endif
diff --git a/root/.tcshrc b/root/.tcshrc
index 64e5ca4..cd20f2d 100644
--- a/root/.tcshrc
+++ b/root/.tcshrc
@@ -18,4 +18,4 @@ if ($term == "xterm" || $term == "vt100" || $term == "vt102" || $term == "vt220"
bindkey "\e[7~" beginning-of-line # Home rxvt/konsole
bindkey "\e[8~" end-of-line # End rxvt/konsole
-endif \ No newline at end of file
+endif
diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php
index 511f333..6b336a2 100644
--- a/usr/local/www/diag_dns.php
+++ b/usr/local/www/diag_dns.php
@@ -208,7 +208,7 @@ include("head.inc"); ?>
}
}
?>
- <font size="-1>">
+ <font size="-1">
<? } ?>
</td></tr></table>
diff --git a/usr/local/www/diag_ping.php b/usr/local/www/diag_ping.php
index e2c3037..2270264 100755
--- a/usr/local/www/diag_ping.php
+++ b/usr/local/www/diag_ping.php
@@ -112,7 +112,7 @@ include("head.inc"); ?>
<td width="78%" class="vtable">
<select name="sourceip" class="formselect">
<option value="">Default</option>
- <?php $sourceips = get_possible_traffic_source_addresses();
+ <?php $sourceips = get_possible_traffic_source_addresses(true);
foreach ($sourceips as $sip):
$selected = "";
if (!link_interface_to_bridge($sip['value']) && ($sip['value'] == $sourceip))
diff --git a/usr/local/www/diag_testport.php b/usr/local/www/diag_testport.php
index b9abedf..799ed83 100644
--- a/usr/local/www/diag_testport.php
+++ b/usr/local/www/diag_testport.php
@@ -144,7 +144,7 @@ include("head.inc"); ?>
<td width="78%" class="vtable">
<select name="sourceip" class="formselect">
<option value="">Any</option>
- <?php $sourceips = get_possible_traffic_source_addresses();
+ <?php $sourceips = get_possible_traffic_source_addresses(true);
foreach ($sourceips as $sip):
$selected = "";
if (!link_interface_to_bridge($sip['value']) && ($sip['value'] == $sourceip))
diff --git a/usr/local/www/diag_traceroute.php b/usr/local/www/diag_traceroute.php
index 467138b..6399708 100755
--- a/usr/local/www/diag_traceroute.php
+++ b/usr/local/www/diag_traceroute.php
@@ -114,7 +114,7 @@ if (!isset($do_traceroute)) {
<td width="78%" class="vtable">
<select name="sourceip" class="formselect">
<option value="">Any</option>
- <?php $sourceips = get_possible_traffic_source_addresses();
+ <?php $sourceips = get_possible_traffic_source_addresses(true);
foreach ($sourceips as $sip):
$selected = "";
if (!link_interface_to_bridge($sip['value']) && ($sip['value'] == $sourceip))
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php
index 77808e4..4105343 100755
--- a/usr/local/www/firewall_rules_edit.php
+++ b/usr/local/www/firewall_rules_edit.php
@@ -3,7 +3,7 @@
/*
firewall_rules_edit.php
part of pfSense (http://www.pfsense.com)
- Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com)
+ Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com)
originally part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
@@ -91,18 +91,18 @@ if (isset($id) && $a_filter[$id]) {
if (isset($a_filter[$id]['floating']) || $if == "FloatingRules") {
$pconfig['floating'] = $a_filter[$id]['floating'];
- if (isset($a_filter[$id]['interface']) && $a_filter[$id]['interface'] <> "")
+ if (isset($a_filter[$id]['interface']) && $a_filter[$id]['interface'] <> "")
$pconfig['interface'] = $a_filter[$id]['interface'];
}
-
- if (isset($a_filter['floating']))
+
+ if (isset($a_filter['floating']))
$pconfig['floating'] = "yes";
if (isset($a_filter[$id]['direction']))
- $pconfig['direction'] = $a_filter[$id]['direction'];
+ $pconfig['direction'] = $a_filter[$id]['direction'];
if (isset($a_filter[$id]['ipprotocol']))
- $pconfig['ipprotocol'] = $a_filter[$id]['ipprotocol'];
+ $pconfig['ipprotocol'] = $a_filter[$id]['ipprotocol'];
if (isset($a_filter[$id]['protocol']))
$pconfig['proto'] = $a_filter[$id]['protocol'];
@@ -133,16 +133,16 @@ if (isset($id) && $a_filter[$id]) {
if (isset($a_filter[$id]['tcpflags_any']))
$pconfig['tcpflags_any'] = true;
else {
- if (isset($a_filter[$id]['tcpflags1']) && $a_filter[$id]['tcpflags1'] <> "")
+ if (isset($a_filter[$id]['tcpflags1']) && $a_filter[$id]['tcpflags1'] <> "")
$pconfig['tcpflags1'] = $a_filter[$id]['tcpflags1'];
- if (isset($a_filter[$id]['tcpflags2']) && $a_filter[$id]['tcpflags2'] <> "")
+ if (isset($a_filter[$id]['tcpflags2']) && $a_filter[$id]['tcpflags2'] <> "")
$pconfig['tcpflags2'] = $a_filter[$id]['tcpflags2'];
}
- if (isset($a_filter[$id]['tag']) && $a_filter[$id]['tag'] <> "")
+ if (isset($a_filter[$id]['tag']) && $a_filter[$id]['tag'] <> "")
$pconfig['tag'] = $a_filter[$id]['tag'];
if (isset($a_filter[$id]['tagged']) && $a_filter[$id]['tagged'] <> "")
- $pconfig['tagged'] = $a_filter[$id]['tagged'];
+ $pconfig['tagged'] = $a_filter[$id]['tagged'];
if (isset($a_filter[$id]['quick']) && $a_filter[$id]['quick'])
$pconfig['quick'] = $a_filter[$id]['quick'];
if (isset($a_filter[$id]['allowopts']))
@@ -167,7 +167,7 @@ if (isset($id) && $a_filter[$id]) {
/* Multi-WAN next-hop support */
$pconfig['gateway'] = $a_filter[$id]['gateway'];
-
+
/* Shaper support */
$pconfig['defaultqueue'] = (($a_filter[$id]['ackqueue'] == "none") ? '' : $a_filter[$id]['defaultqueue']);
$pconfig['ackqueue'] = (($a_filter[$id]['ackqueue'] == "none") ? '' : $a_filter[$id]['ackqueue']);
@@ -330,7 +330,7 @@ if ($_POST) {
if(($_POST['statetype'] == "synproxy state") && ($_POST['gateway'] != ""))
$input_errors[] = sprintf(gettext("%s is only valid if the gateway is set to 'default'."),$_POST['statetype']);
}
-
+
if ( isset($a_filter[$id]['associated-rule-id'])===false &&
(!(is_specialnet($_POST['srctype']) || ($_POST['srctype'] == "single"))) ) {
$reqdfields[] = "srcmask";
@@ -354,7 +354,7 @@ if ($_POST) {
}
if ($_POST['srcbeginport'] && !is_portoralias($_POST['srcbeginport']))
- $input_errors[] = sprintf(gettext("%s is not a valid start source port. It must be a port alias or integer between 1 and 65535."),$_POST['srcbeginposrt']);
+ $input_errors[] = sprintf(gettext("%s is not a valid start source port. It must be a port alias or integer between 1 and 65535."),$_POST['srcbeginposrt']);
if ($_POST['srcendport'] && !is_portoralias($_POST['srcendport']))
$input_errors[] = sprintf(gettext("%s is not a valid end source port. It must be a port alias or integer between 1 and 65535."),$_POST['srcendport']);
if ($_POST['dstbeginport'] && !is_portoralias($_POST['dstbeginport']))
@@ -367,8 +367,8 @@ if ($_POST) {
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'])))
+ 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'])
@@ -377,8 +377,8 @@ if ($_POST) {
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'])))
+ 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';
}
@@ -445,7 +445,7 @@ if ($_POST) {
if ($_POST['defaultqueue'] == "" )
$input_errors[] = gettext("You have to select a queue when you select an acknowledge queue too.");
else if ($_POST['ackqueue'] == $_POST['defaultqueue'])
- $input_errors[] = gettext("Acknowledge queue and Queue cannot be the same.");
+ $input_errors[] = gettext("Acknowledge queue and Queue cannot be the same.");
}
if (isset($_POST['floating']) && $_POST['pdnpipe'] != "" && (empty($_POST['direction']) || $_POST['direction'] == "any"))
$input_errors[] = gettext("You can not use limiters in Floating rules without choosing a direction.");
@@ -458,7 +458,7 @@ if ($_POST) {
$input_errors[] = gettext("In and Out Queue cannot be the same.");
else if ($dnqlist[$_POST['pdnpipe']][0] == "?" && $dnqlist[$_POST['dnpipe']][0] <> "?")
$input_errors[] = gettext("You cannot select one queue and one virtual interface for IN and Out. both must be from the same type.");
- else if ($dnqlist[$_POST['dnpipe']][0] == "?" && $dnqlist[$_POST['pdnpipe']][0] <> "?")
+ else if ($dnqlist[$_POST['dnpipe']][0] == "?" && $dnqlist[$_POST['pdnpipe']][0] <> "?")
$input_errors[] = gettext("You cannot select one queue and one virtual interface for IN and Out. both must be from the same type.");
if ($_POST['direction'] == "out" && empty($_POST['gateway']))
$input_errors[] = gettext("Please select a gateway, normaly the interface selected gateway, so the limiters work correctly");
@@ -485,7 +485,7 @@ if ($_POST) {
$input_errors[] = gettext("If you specify TCP flags that should be set you should specify out of which flags as well.");
}
- // Allow extending of the firewall edit page and include custom input validation
+ // Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/input_validation");
if (!$input_errors) {
@@ -597,7 +597,7 @@ if ($_POST) {
if ($_POST['gateway'] != "") {
$filterent['gateway'] = $_POST['gateway'];
}
-
+
if ($_POST['defaultqueue'] != "") {
$filterent['defaultqueue'] = $_POST['defaultqueue'];
if ($_POST['ackqueue'] != "")
@@ -613,7 +613,7 @@ if ($_POST) {
if ($_POST['l7container'] != "") {
$filterent['l7container'] = $_POST['l7container'];
}
-
+
if ($_POST['sched'] != "") {
$filterent['sched'] = $_POST['sched'];
}
@@ -647,7 +647,7 @@ if ($_POST) {
$filterent['updated'] = make_config_revision_entry();
- // Allow extending of the firewall edit page and include custom input validation
+ // Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_write_config");
if (isset($id) && $a_filter[$id])
@@ -698,12 +698,12 @@ include("head.inc");
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="firewall rules edit">
<tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Firewall rule");?></td>
- </tr>
+ </tr>
<?php
- // Allow extending of the firewall edit page and include custom input validation
+ // Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/htmlphpearly");
?>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Action");?></td>
<td width="78%" class="vtable">
<select name="type" class="formselect">
@@ -719,7 +719,7 @@ include("head.inc");
<br/>
<span class="vexpl">
<?=gettext("Choose what to do with packets that match the criteria specified below.");?> <br/>
- <?=gettext("Hint: the difference between block and reject is that with reject, a packet (TCP RST or ICMP port unreachable for UDP) is returned to the sender, whereas with block the packet is dropped silently. In either case, the original packet is discarded.");?>
+ <?=gettext("Hint: the difference between block and reject is that with reject, a packet (TCP RST or ICMP port unreachable for UDP) is returned to the sender, whereas with block the packet is dropped silently. In either case, the original packet is discarded.");?>
</span>
</td>
</tr>
@@ -778,15 +778,14 @@ include("head.inc");
<select name="interface[]" title="Select interfaces..." multiple="multiple" style="width:350px;" class="chzn-select" tabindex="2" <?=$edit_disabled;?>>
<?php else: ?>
<select name="interface" class="formselect" <?=$edit_disabled;?>>
-<?php
- endif;
+<?php endif;
/* add group interfaces */
if (is_array($config['ifgroups']['ifgroupentry']))
foreach($config['ifgroups']['ifgroupentry'] as $ifgen)
if (have_ruleint_access($ifgen['ifname']))
$interfaces[$ifgen['ifname']] = $ifgen['ifname'];
$ifdescs = get_configured_interface_with_descr();
- // Allow extending of the firewall edit page and include custom input validation
+ // Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_interfaces_edit");
foreach ($ifdescs as $ifent => $ifdesc)
if(have_ruleint_access($ifent))
@@ -795,14 +794,14 @@ include("head.inc");
if(have_ruleint_access("l2tp"))
$interfaces['l2tp'] = "L2TP VPN";
if ($config['pptpd']['mode'] == "server")
- if(have_ruleint_access("pptp"))
+ if(have_ruleint_access("pptp"))
$interfaces['pptp'] = "PPTP VPN";
-
+
if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
$interfaces['pppoe'] = "PPPoE VPN";
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable']))
- if(have_ruleint_access("enc0"))
+ if(have_ruleint_access("enc0"))
$interfaces["enc0"] = "IPsec";
/* add openvpn/tun interfaces */
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"])
@@ -829,10 +828,10 @@ include("head.inc");
foreach ($directions as $direction): ?>
<option value="<?=$direction;?>"
<?php if ($direction == $pconfig['direction']): ?>
- selected="selected"
+ selected="selected"
<?php endif; ?>
><?=$direction;?></option>
- <?php endforeach; ?>
+ <?php endforeach; ?>
</select>
<input type="hidden" id="floating" name="floating" value="floating" />
</td>
@@ -846,10 +845,10 @@ include("head.inc");
foreach ($ipproto as $proto => $name): ?>
<option value="<?=$proto;?>"
<?php if ($proto == $pconfig['ipprotocol']): ?>
- selected="selected"
+ selected="selected"
<?php endif; ?>
><?=$name;?></option>
- <?php endforeach; ?>
+ <?php endforeach; ?>
</select>
<strong><?=gettext("Select the Internet Protocol version this rule applies to");?></strong><br />
</td>
@@ -922,7 +921,7 @@ include("head.inc");
<?php if (!$sel &&
((is_ipaddrv6($pconfig['src']) && $pconfig['srcmask'] == 128) ||
(is_ipaddrv4($pconfig['src']) && $pconfig['srcmask'] == 32) || is_alias($pconfig['src'])))
- { echo "selected=\"selected\""; $sel = 1; }
+ { echo "selected=\"selected\""; $sel = 1; }
?>
> <?=gettext("Single host or alias");?></option>
<option value="network" <?php if (!$sel) echo "selected=\"selected\""; ?>><?=gettext("Network");?></option>
@@ -931,10 +930,10 @@ include("head.inc");
<?php endif; ?>
<?php if(have_ruleint_access("pppoe")): ?>
<option value="pppoe" <?php if ($pconfig['src'] == "pppoe") { echo "selected=\"selected\""; } ?>><?=gettext("PPPoE clients");?></option>
- <?php endif; ?>
- <?php if(have_ruleint_access("l2tp")): ?>
- <option value="l2tp" <?php if ($pconfig['src'] == "l2tp") { echo "selected=\"selected\""; } ?>><?=gettext("L2TP clients");?></option>
- <?php endif; ?>
+ <?php endif; ?>
+ <?php if(have_ruleint_access("l2tp")): ?>
+ <option value="l2tp" <?php if ($pconfig['src'] == "l2tp") { echo "selected=\"selected\""; } ?>><?=gettext("L2TP clients");?></option>
+ <?php endif; ?>
<?php
foreach ($ifdisp as $ifent => $ifdesc): ?>
<?php if(have_ruleint_access($ifent)): ?>
@@ -1031,10 +1030,10 @@ include("head.inc");
<?php endif; ?>
<?php if(have_ruleint_access("pppoe")): ?>
<option value="pppoe" <?php if ($pconfig['dst'] == "pppoe") { echo "selected=\"selected\""; } ?>><?=gettext("PPPoE clients");?></option>
- <?php endif; ?>
+ <?php endif; ?>
<?php if(have_ruleint_access("l2tp")): ?>
- <option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected=\"selected\""; } ?>><?=gettext("L2TP clients");?></option>
- <?php endif; ?>
+ <option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected=\"selected\""; } ?>><?=gettext("L2TP clients");?></option>
+ <?php endif; ?>
<?php foreach ($ifdisp as $if => $ifdesc): ?>
<?php if(have_ruleint_access($if)): ?>
@@ -1054,7 +1053,7 @@ include("head.inc");
/
<select <?=$edit_disabled;?> name="dstmask" class="formselect ipv4v6" id="dstmask">
<?php
- for ($i = 127; $i > 0;
+ for ($i = 127; $i > 0;
$i--): ?>
<option value="<?=$i;?>" <?php if ($i == $pconfig['dstmask']) echo "selected=\"selected\""; ?>><?=$i;?></option>
<?php endfor; ?>
@@ -1138,7 +1137,7 @@ $i--): ?>
</tr>
<tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Advanced features");?></td>
- </tr>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Source OS");?></td>
<td width="78%" class="vtable">
@@ -1150,7 +1149,7 @@ $i--): ?>
<select name="os" id="os" class="formselect">
<?php
$ostypes = array(
- "" => gettext("any"),
+ "" => gettext("any"),
"AIX" => "AIX",
"Linux" => "Linux",
"FreeBSD" => "FreeBSD",
@@ -1161,11 +1160,11 @@ $i--): ?>
"Windows" => "Windows",
"Novell" => "Novell",
"NMAP" => "NMAP"
- );
+ );
foreach ($ostypes as $ostype => $descr): ?>
<option value="<?=$ostype;?>" <?php if ($ostype == $pconfig['os']) echo "selected=\"selected\""; ?>><?=htmlspecialchars($descr);?></option>
<?php
- endforeach;
+ endforeach;
?>
</select>
<br />
@@ -1226,19 +1225,19 @@ $i--): ?>
<?=gettext("State Timeout in seconds");?>
</p>
<p><strong><?=gettext("Note: Leave fields blank to disable that feature.");?></strong></p>
- </div>
+ </div>
</td>
</tr>
- <tr id="tcpflags">
+ <tr id="tcpflags">
<td width="22%" valign="top" class="vncell"><?=gettext("TCP flags");?></td>
<td width="78%" class="vtable">
<div id="showtcpflagsbox" <?php if ($pconfig['tcpflags_any'] || $pconfig['tcpflags1'] || $pconfig['tcpflags2']) echo "style='display:none'"; ?>>
- <input type="button" onclick="show_advanced_tcpflags()" value="<?=gettext("Advanced"); ?>" /> - <?=gettext("Show advanced option");?>
- </div>
- <div id="showtcpflagsadv" <?php if (empty($pconfig['tcpflags_any']) && empty($pconfig['tcpflags1']) && empty($pconfig['tcpflags2'])) echo "style='display:none'"; ?>>
+ <input type="button" onclick="show_advanced_tcpflags()" value="<?=gettext("Advanced"); ?>" /> - <?=gettext("Show advanced option");?>
+ </div>
+ <div id="showtcpflagsadv" <?php if (empty($pconfig['tcpflags_any']) && empty($pconfig['tcpflags1']) && empty($pconfig['tcpflags2'])) echo "style='display:none'"; ?>>
<div id="tcpheader" align="center">
<table border="0" cellspacing="0" cellpadding="0">
- <?php
+ <?php
$setflags = explode(",", $pconfig['tcpflags1']);
$outofflags = explode(",", $pconfig['tcpflags2']);
$header = "<td width='40' class='nowrap'></td>";
@@ -1264,7 +1263,7 @@ $i--): ?>
<br/><center>
<input onclick='tcpflags_anyclick(this);' type='checkbox' name='tcpflags_any' value='on' <?php if ($pconfig['tcpflags_any']) echo "checked=\"checked\""; ?> /><strong><?=gettext("Any flags.");?></strong><br/></center>
<br/>
- <span class="vexpl"><?=gettext("Use this to choose TCP flags that must ".
+ <span class="vexpl"><?=gettext("Use this to choose TCP flags that must ".
"be set or cleared for this rule to match.");?></span>
</div>
</td>
@@ -1288,7 +1287,7 @@ $i--): ?>
<tr><td width="25%"><ul><li><?=gettext("synproxy state");?></li></ul></td><td><?=gettext("Proxies incoming TCP connections to help protect servers from spoofed TCP SYN floods. This option includes the functionality of keep state and modulate state combined.");?></td></tr>
<tr><td width="25%"><ul><li><?=gettext("none");?></li></ul></td><td><?=gettext("Do not use state mechanisms to keep track. This is only useful if you're doing advanced queueing in certain situations. Please check the documentation.");?></td></tr>
</table>
- </div>
+ </div>
</td>
</tr>
<tr>
@@ -1405,7 +1404,7 @@ $i--): ?>
continue;
if(($pconfig['ipprotocol'] == "inet") && !(($gw['ipprotocol'] == "inet") || (is_ipaddrv4($gw['gateway']))))
continue;
- if($gw == "")
+ if($gw == "")
continue;
if($gwname == $pconfig['gateway']) {
$selected = " selected=\"selected\"";
@@ -1462,10 +1461,10 @@ $i--): ?>
$dnqselected = 1;
echo " selected=\"selected\"";
}
- echo ">{$dnq}</option>";
+ echo ">{$dnq}</option>";
}
?>
- </select> /
+ </select> /
<select name="pdnpipe">
<?php
$dnqselected = 0;
@@ -1480,7 +1479,7 @@ $i--): ?>
$dnqselected = 1;
echo " selected=\"selected\"";
}
- echo ">{$dnq}</option>";
+ echo ">{$dnq}</option>";
}
?>
</select>
@@ -1515,10 +1514,10 @@ $i--): ?>
if (isset($ifdisp[$q]))
echo ">{$ifdisp[$q]}</option>";
else
- echo ">{$q}</option>";
+ echo ">{$q}</option>";
}
?>
- </select> /
+ </select> /
<select name="defaultqueue">
<?php
$qselected = 0;
@@ -1536,7 +1535,7 @@ $i--): ?>
if (isset($ifdisp[$q]))
echo ">{$ifdisp[$q]}</option>";
else
- echo ">{$q}</option>";
+ echo ">{$q}</option>";
}
?>
</select>
@@ -1552,31 +1551,31 @@ $i--): ?>
<input type="button" onclick="show_advanced_layer7()" value="<?=gettext("Advanced"); ?>" /> - <?=gettext("Show advanced option");?>
</div>
<div id="showlayer7adv" <?php if (empty($pconfig['l7container'])) echo "style='display:none'"; ?>>
- <select name="l7container">
+ <select name="l7container">
<?php
- if (!is_array($l7clist))
- $l7clist = array();
- echo "<option value=\"\"";
- echo " >none</option>";
- foreach ($l7clist as $l7ckey) {
- echo "<option value=\"{$l7ckey}\"";
- if ($l7ckey == $pconfig['l7container']) {
- echo " selected=\"selected\"";
+ if (!is_array($l7clist))
+ $l7clist = array();
+ echo "<option value=\"\"";
+ echo " >none</option>";
+ foreach ($l7clist as $l7ckey) {
+ echo "<option value=\"{$l7ckey}\"";
+ if ($l7ckey == $pconfig['l7container']) {
+ echo " selected=\"selected\"";
+ }
+ echo ">{$l7ckey}</option>";
}
- echo ">{$l7ckey}</option>";
- }
?>
- </select>
- <br/>
- <span class="vexpl">
- <?=gettext("Choose a Layer7 container to apply application protocol inspection rules. " .
- "These are valid for TCP and UDP protocols only.");?>
- </span>
- </div>
- </td>
- </tr>
+ </select>
+ <br/>
+ <span class="vexpl">
+ <?=gettext("Choose a Layer7 container to apply application protocol inspection rules. " .
+ "These are valid for TCP and UDP protocols only.");?>
+ </span>
+ </div>
+ </td>
+ </tr>
<?php
- // Allow extending of the firewall edit page and include custom input validation
+ // Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/htmlphplate");
?>
<?php
@@ -1633,11 +1632,11 @@ $has_updated_time = (isset($a_filter[$id]['updated']) && is_array($a_filter[$id]
var customarray = <?= json_encode(get_alias_list("port")) ?>;
var oTextbox1 = new AutoSuggestControl(document.getElementById("src"), new StateSuggestions(addressarray));
- var oTextbox2 = new AutoSuggestControl(document.getElementById("srcbeginport_cust"), new StateSuggestions(customarray));
- var oTextbox3 = new AutoSuggestControl(document.getElementById("srcendport_cust"), new StateSuggestions(customarray));
- var oTextbox4 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray));
- var oTextbox5 = new AutoSuggestControl(document.getElementById("dstbeginport_cust"), new StateSuggestions(customarray));
- var oTextbox6 = new AutoSuggestControl(document.getElementById("dstendport_cust"), new StateSuggestions(customarray));
+ var oTextbox2 = new AutoSuggestControl(document.getElementById("srcbeginport_cust"), new StateSuggestions(customarray));
+ var oTextbox3 = new AutoSuggestControl(document.getElementById("srcendport_cust"), new StateSuggestions(customarray));
+ var oTextbox4 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray));
+ var oTextbox5 = new AutoSuggestControl(document.getElementById("dstbeginport_cust"), new StateSuggestions(customarray));
+ var oTextbox6 = new AutoSuggestControl(document.getElementById("dstendport_cust"), new StateSuggestions(customarray));
//]]>
</script>
<?php include("fend.inc"); ?>
diff --git a/usr/local/www/interfaces_bridge_edit.php b/usr/local/www/interfaces_bridge_edit.php
index ca54db0..61e7159 100644
--- a/usr/local/www/interfaces_bridge_edit.php
+++ b/usr/local/www/interfaces_bridge_edit.php
@@ -378,8 +378,8 @@ function show_source_port_range() {
<input name="holdcnt" type="text" class="formfld unkown" id="holdcnt" value="<?=htmlspecialchars($pconfig['holdcnt']);?>" />
<br/>
<span class="vexpl">
- <?=gettext("Set the transmit hold count for Spanning Tree. This is the num- " .
- "ber of packets transmitted before being rate limited. The " .
+ <?=gettext("Set the transmit hold count for Spanning Tree. This is the number" .
+ " of packets transmitted before being rate limited. The " .
"default is 6. The minimum is 1 and the maximum is 10."); ?>
</span>
</td></tr>
diff --git a/usr/local/www/interfaces_gif_edit.php b/usr/local/www/interfaces_gif_edit.php
index 59852af..2283280 100644
--- a/usr/local/www/interfaces_gif_edit.php
+++ b/usr/local/www/interfaces_gif_edit.php
@@ -166,7 +166,7 @@ include("head.inc");
?>
</select>
<br/>
- <span class="vexpl"><?=gettext("The interface here servers as the local address to be used for the gif tunnel."); ?></span></td>
+ <span class="vexpl"><?=gettext("The interface here serves as the local address to be used for the gif tunnel."); ?></span></td>
</tr>
<tr>
<td valign="top" class="vncellreq"><?=gettext("gif remote address"); ?></td>
diff --git a/usr/local/www/services_dnsmasq.php b/usr/local/www/services_dnsmasq.php
index 1d67b6f..59f55f2 100755
--- a/usr/local/www/services_dnsmasq.php
+++ b/usr/local/www/services_dnsmasq.php
@@ -51,8 +51,15 @@ $pconfig['dhcpfirst'] = isset($config['dnsmasq']['dhcpfirst']);
$pconfig['strict_order'] = isset($config['dnsmasq']['strict_order']);
$pconfig['domain_needed'] = isset($config['dnsmasq']['domain_needed']);
$pconfig['no_private_reverse'] = isset($config['dnsmasq']['no_private_reverse']);
+$pconfig['port'] = $config['dnsmasq']['port'];
$pconfig['custom_options'] = $config['dnsmasq']['custom_options'];
+$pconfig['strictbind'] = isset($config['dnsmasq']['strictbind']);
+if (!empty($config['dnsmasq']['interface']))
+ $pconfig['interface'] = explode(",", $config['dnsmasq']['interface']);
+else
+ $pconfig['interface'] = array();
+
if (!is_array($config['dnsmasq']['hosts']))
$config['dnsmasq']['hosts'] = array();
@@ -76,6 +83,20 @@ if ($_POST) {
$config['dnsmasq']['domain_needed'] = ($_POST['domain_needed']) ? true : false;
$config['dnsmasq']['no_private_reverse'] = ($_POST['no_private_reverse']) ? true : false;
$config['dnsmasq']['custom_options'] = str_replace("\r\n", "\n", $_POST['custom_options']);
+ $config['dnsmasq']['strictbind'] = ($_POST['strictbind']) ? true : false;
+
+ if ($_POST['port'])
+ if(is_port($_POST['port']))
+ $config['dnsmasq']['port'] = $_POST['port'];
+ else
+ $input_errors[] = gettext("You must specify a valid port number");
+ else if (isset($config['dnsmasq']['port']))
+ unset($config['dnsmasq']['port']);
+
+ if (is_array($_POST['interface']))
+ $config['dnsmasq']['interface'] = implode(",", $_POST['interface']);
+ elseif (isset($config['dnsmasq']['interface']))
+ unset($config['dnsmasq']['interface']);
if ($config['dnsmasq']['custom_options']) {
$args = '';
@@ -230,6 +251,49 @@ function show_advanced_dns() {
</td>
</tr>
<tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Listen Port");?></td>
+ <td width="78%" class="vtable"><p>
+ <input name="port" type="text" id="port" size="6" <?php if ($pconfig['port']) echo "value=\"{$pconfig['port']}\"";?>>
+ <br /><br />
+ <?=gettext("The port used for responding to DNS queries. It should normally be left blank unless another service needs to bind to TCP/UDP port 53.");?></p>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" rowspan="2" class="vncellreq"><?=gettext("Interfaces"); ?></td>
+ <td width="78%" class="vtable">
+ <?php
+ $interface_addresses = get_possible_listen_ips(true);
+ $size=count($interface_addresses)+1;
+ ?>
+ <?=gettext("Interface IPs used by the DNS Forwarder for responding to queries from clients. If an interface has both IPv4 and IPv6 IPs, both are used. Queries to other interface IPs not selected below are discarded. The default behavior is to respond to queries on every available IPv4 and IPv6 address.");?>
+ <br /><br />
+ <select id="interface" name="interface[]" multiple="true" class="formselect" size="<?php echo $size; ?>">
+ <option value="" <?php if (empty($pconfig['interface'])) echo 'selected="selected"'; ?>>All</option>
+ <?php foreach ($interface_addresses as $laddr):
+ $selected = "";
+ if (in_array($laddr['value'], $pconfig['interface']))
+ $selected = 'selected="selected"';
+ ?>
+ <option value="<?=$laddr['value'];?>" <?=$selected;?>>
+ <?=htmlspecialchars($laddr['name']);?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ <br /><br />
+ </td>
+ </tr>
+ <tr>
+ <td width="78%" class="vtable"><p>
+ <input name="strictbind" type="checkbox" id="strictbind" value="yes" <?php if ($pconfig['strictbind'] == "yes") echo "checked";?>>
+ <strong><?=gettext("Strict Interface Binding");?></strong>
+ <br />
+ <?= gettext("If this option is set, the DNS forwarder will only bind to the interfaces containing the IP addresses selected above, rather than binding to all interfaces and discarding queries to other addresses."); ?>
+ <br /><br />
+ <?= gettext("NOTE: This option does NOT work with IPv6. If set, dnsmasq will not bind to IPv6 addresses."); ?>
+ </p>
+ </td>
+ </tr>
+ <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Advanced");?></td>
<td width="78%" class="vtable"><p>
<div id="showadvbox" <?php if ($pconfig['custom_options']) echo "style='display:none'"; ?>>
diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml
index 513a286..1f09263 100644
--- a/usr/local/www/wizards/setup_wizard.xml
+++ b/usr/local/www/wizards/setup_wizard.xml
@@ -388,7 +388,7 @@
<![CDATA[
if (is_array($config['gateways']['gateway_item']))
foreach ($config['gateways']['gateway_item'] as $gw)
- if ($gw['name'] == 'WANGW')
+ if ($gw['name'] == 'WANGW' || (!empty($config['wizardtemp']['wangateway']) && $gw['gateway'] == $config['wizardtemp']['wangateway']))
$config['wizardtemp']['wangateway'] = $gw['gateway'];
]]>
</stepbeforeformdisplay>
@@ -573,10 +573,16 @@
if (!is_array($config['gateways']['gateway_item']))
$config['gateways']['gateway_item'] = array();
$found = false;
+ $defaultgw_found = false;
foreach ($config['gateways']['gateway_item'] as & $gw) {
- if ($gw['name'] == 'WANGW') {
+ if ($gw['interface'] != "wan")
+ continue;
+ if (isset($gw['defaultgw']))
+ $defaultgw_found = true;
+ if ($gw['name'] == 'WANGW' || (!empty($config['wizardtemp']['wangateway']) && $gw['gateway'] == $config['wizardtemp']['wangateway'])) {
$found = true;
$gw['gateway'] = $config['wizardtemp']['wangateway'];
+ $config['interfaces']['wan']['gateway'] = $gw['name'];
}
}
if (!$found) {
@@ -586,10 +592,10 @@
$newgw['name'] = "WANGW";
$newgw['weight'] = 1;
$newgw['descr'] = "WAN Gateway";
- $newgw['defaultgw'] = true;
+ $newgw['defaultgw'] = !$defaultgw_found;
$config['gateways']['gateway_item'][] = $newgw;
+ $config['interfaces']['wan']['gateway'] = "WANGW";
}
- $config['interfaces']['wan']['gateway'] = "WANGW";
}
unset($config['wizardtemp']);
write_config();
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
index a5a73e1..b6bb470 100755
--- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
@@ -1406,7 +1406,6 @@ function apply_all_choosen_items() {
$rule['type'] = "match";
$rule['interface'] = $interfacelist;
$rule['descr'] = gettext("Penalty Box");
- $rule['source']['any'] = TRUE;
$rule['defaultqueue'] = "qOthersLow";
$rule['source']['address'] = $config['ezshaper']['step4']['address'];
$rule['destination']['any'] = TRUE;
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
index 8a1c8c6..f87ba4c 100755
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
@@ -1462,7 +1462,6 @@ function apply_all_choosen_items() {
$rule['type'] = "match";
$rule['interface'] = $interfacelist;
$rule['descr'] = gettext("Penalty Box");
- $rule['source']['any'] = TRUE;
$rule['defaultqueue'] = "qOthersLow";
$rule['source']['address'] = $config['ezshaper']['step4']['address'];
$rule['destination']['any'] = TRUE;
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
index 8f53d60..a8e7ec9 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
@@ -1203,7 +1203,6 @@ function apply_all_choosen_items() {
$rule['type'] = "match";
$rule['interface'] = "wan";
$rule['descr'] = gettext("Penalty Box");
- $rule['source']['any'] = TRUE;
$rule['defaultqueue'] = "qOthersLow";
$rule['source']['address'] = $config['ezshaper']['step4']['address'];
$rule['destination']['any'] = TRUE;
OpenPOWER on IntegriCloud