diff options
author | Seth Mos <seth.mos@dds.nl> | 2011-08-29 09:04:07 +0200 |
---|---|---|
committer | Seth Mos <seth.mos@dds.nl> | 2011-08-29 09:05:07 +0200 |
commit | 791d3ac98b29f79d2586dd94c91bb4e877ed0b08 (patch) | |
tree | 382652b02213264da69ed89d9815bce0540deeb6 /etc/inc/gwlb.inc | |
parent | 8d29f477a2174582e5a08d0753b3452c7988bef2 (diff) | |
download | pfsense-791d3ac98b29f79d2586dd94c91bb4e877ed0b08.zip pfsense-791d3ac98b29f79d2586dd94c91bb4e877ed0b08.tar.gz |
Add a possible "dynamic6 type to differentiate between IPv6 and IPv4 dynamic connections"
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r-- | etc/inc/gwlb.inc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 95b4711..dd653c9 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -285,11 +285,14 @@ 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(empty($gateway['gateway']) || $gateway['gateway'] == "dynamic") { + if(empty($gateway['gateway']) || preg_match("/dynamic/", $gateway['gateway'])) { $gateway['gateway'] = get_interface_gateway($gateway['interface']); + if(preg_match("/dynamic/", $gateway['gateway'])) { + $dynstr = $gateway['gateway']; + } /* no IP address found, set to dynamic */ if(! is_ipaddr($gateway['gateway'])) { - $gateway['gateway'] = "dynamic"; + $gateway['gateway'] = "{$dynstr}"; } $gateway['dynamic'] = true; } @@ -397,7 +400,7 @@ function return_gateways_array($disabled = false) { /* Loopback dummy for dynamic interfaces without a IP */ if (!is_ipaddrv6($gateway['gateway']) && $gateway['dynamic'] == true) - $gateway['gateway'] = "dynamic"; + $gateway['gateway'] = "dynamic6"; /* automatically skip known static and dynamic gateways we have a array entry for */ foreach($gateways_arr as $gateway_item) { @@ -455,7 +458,7 @@ function return_gateway_groups_array() { $dfltgwdown = true; } if ($dfltgwdown == true && !empty($upgw)) { - if ($gateways_arr[$upgw]['gateway'] == "dynamic") + if (preg_match("/dynamic", $gateways_arr[$upgw]['gateway'])) $gateways_arr[$upgw]['gateway'] = get_interface_gateway($gateways_arr[$upgw]['friendlyiface']); if (is_ipaddr($gateways_arr[$upgw]['gateway'])) { log_error("Default gateway down setting {$upgw} as default!"); |