diff options
author | Ermal <eri@pfsense.org> | 2010-10-01 16:51:21 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-10-01 16:51:21 +0000 |
commit | 78ae2b1406d4651d408bb2db843d531dc9dffd08 (patch) | |
tree | 42059caa06a6c9ce24ec3258e0a71f9aa29c6f71 /etc | |
parent | d44d26c13ea8e1bc13657f0a186c3cfda7b28d47 (diff) | |
download | pfsense-78ae2b1406d4651d408bb2db843d531dc9dffd08.zip pfsense-78ae2b1406d4651d408bb2db843d531dc9dffd08.tar.gz |
Make sure we do not overwrite the gateway stored in config with a dynamic gateway info. Correct POST var name(Found by ghnb). Also correctly reload only the defaultgw interface changed only if it is different than the present one.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/gwlb.inc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 3ccbbb7..ffc7c37 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -275,7 +275,7 @@ function return_gateways_array($disabled = false) { /* Process/add all the configured gateways. */ if (is_array($config['gateways']['gateway_item'])) { foreach($config['gateways']['gateway_item'] as $gateway) { - if($gateway['gateway'] == "dynamic") { + if(empty($gateway['gateway']) || $gateway['gateway'] == "dynamic") { $gateway['gateway'] = get_interface_gateway($gateway['interface']); /* no IP address found, set to dynamic */ if(! is_ipaddr($gateway['gateway'])) @@ -331,12 +331,8 @@ function return_gateways_array($disabled = false) { /* automatically skip known static and dynamic gateways we have a array entry for */ foreach($gateways_arr as $gateway_item) { - if ($ifname == $gateway_item['friendlyiface'] || $friendly == $gateway_item['name']) { - if ($gateway_item['gateway'] == $gateway['gateway']) + if ($ifname == $gateway_item['friendlyiface'] && $friendly == $gateway_item['name']) continue 2; - if ($gateway_item['gateway'] == "dynamic") - continue 2; - } } if (is_ipaddr($gateway['gateway'])) |