diff options
-rw-r--r-- | etc/inc/gwlb.inc | 56 |
1 files changed, 12 insertions, 44 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 50eabc1..e3cfd39 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -371,55 +371,23 @@ function return_gateways_array($disabled = false, $localhost = false) { if (empty($gateway['gateway']) || $gateway['gateway'] == "dynamic") { 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") { /* 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 |