diff options
author | avandeweghe <avandeweghe@gmail.com> | 2013-04-15 20:37:06 -0300 |
---|---|---|
committer | avandeweghe <avandeweghe@gmail.com> | 2013-04-15 20:37:06 -0300 |
commit | 4fdd86a37e8ef82298bed1ec684280644f07b61f (patch) | |
tree | ea7fa731a0d72be9089fdd6d2098ad220f708621 /etc/inc/gwlb.inc | |
parent | f803db6a51e71bc1b6f49edc68796a121c34d5d6 (diff) | |
download | pfsense-4fdd86a37e8ef82298bed1ec684280644f07b61f.zip pfsense-4fdd86a37e8ef82298bed1ec684280644f07b61f.tar.gz |
Add default case when detecting dynamic gateway ip
Add a default to $wancfg['ipaddr'] case for both ipv4 and ipv6 to allow gateway ip to be returned rather then 'dynamic' for an openvpn connection
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r-- | etc/inc/gwlb.inc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 4e9ca84..f842857 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -383,6 +383,14 @@ function return_gateways_array($disabled = false, $localhost = false) { $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; } } @@ -403,6 +411,14 @@ function return_gateways_array($disabled = false, $localhost = false) { $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; } } } else { |