diff options
author | Seth Mos <seth.mos@dds.nl> | 2011-08-26 13:12:08 +0200 |
---|---|---|
committer | Seth Mos <seth.mos@dds.nl> | 2011-08-26 13:12:08 +0200 |
commit | 2feb85af000bcf0ba4f9777b0f41c5dc7286b202 (patch) | |
tree | 81183be241a5fd813642359913d4db7a99973e2d /etc/inc/gwlb.inc | |
parent | 7671c94009e66222ff13628e70d427366bb66283 (diff) | |
download | pfsense-2feb85af000bcf0ba4f9777b0f41c5dc7286b202.zip pfsense-2feb85af000bcf0ba4f9777b0f41c5dc7286b202.tar.gz |
Add a interface_has_gatewayv6() function to determine if a interface has a IPv6 gateway.
Implement that function return_gateways_array() to prevent ghost entries
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r-- | etc/inc/gwlb.inc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 8ed9529..95b4711 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -371,7 +371,7 @@ function return_gateways_array($disabled = false) { /* Process/add dynamic v6 gateways. */ foreach($iflist as $ifname => $friendly ) { - if(! interface_has_gateway($ifname)) + if(! interface_has_gatewayv6($ifname)) continue; if (empty($config['interfaces'][$ifname])) @@ -412,7 +412,6 @@ function return_gateways_array($disabled = false) { $gateway['descr'] = "Interface {$friendly} Dynamic Gateway"; $gateways_arr[$gateway['name']] = $gateway; } - return($gateways_arr); } @@ -623,7 +622,7 @@ function get_interface_gateway($interface, &$dynamic = false) { } // for dynamic interfaces we handle them through the $interface_router file. - if (!is_ipaddr($gw) && !is_ipaddr($gwcfg['ipaddr'])) { + if (!is_ipaddrv4($gw) && !is_ipaddrv4($gwcfg['ipaddr'])) { $realif = get_real_interface($interface); if (file_exists("{$g['tmp_path']}/{$realif}_router")) { $gw = trim(file_get_contents("{$g['tmp_path']}/{$realif}_router"), " \n"); @@ -653,7 +652,7 @@ function get_interface_gateway_v6($interface, &$dynamic = false) { } // for dynamic interfaces we handle them through the $interface_router file. - if (!is_ipaddrv6($gw) && !is_ipaddr($gwcfg['ipaddrv6'])) { + if (!is_ipaddrv6($gw) && !is_ipaddrv6($gwcfg['ipaddrv6'])) { $realif = get_real_interface($interface); if (file_exists("{$g['tmp_path']}/{$realif}_routerv6")) { $gw = trim(file_get_contents("{$g['tmp_path']}/{$realif}_routerv6"), " \n"); |