diff options
author | Camlin <camlin@users.noreply.github.com> | 2014-04-18 10:43:48 +0100 |
---|---|---|
committer | Camlin <camlin@users.noreply.github.com> | 2014-04-18 10:43:48 +0100 |
commit | 8c7e38ff68a41df43ecd2e724291834586e14754 (patch) | |
tree | 3c3649e7235c582b7dfc365c55d9e82f1a5d8190 /etc/inc | |
parent | 302c005e1123add037411c30e035d5d715b51424 (diff) | |
download | pfsense-8c7e38ff68a41df43ecd2e724291834586e14754.zip pfsense-8c7e38ff68a41df43ecd2e724291834586e14754.tar.gz |
[pfSense - Bug #3607] Ensure gateway detection can cope with the gateway being a dynamically assigned PPoE interface.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/gwlb.inc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 79e9ccd..d9b0638 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -161,8 +161,14 @@ EOD; if(in_array($gateway['monitor'], $monitor_ips)) continue; - /* Interface ip is needed since apinger will bind a socket to it. */ - if (is_ipaddrv4($gateway['gateway'])) { + /* Interface ip is needed since apinger will bind a socket to it. + * However the config GUI should already have checked this and when + * PPoE is used the IP address is set to "dynamic". So using is_ipaddrv4 + * or is_ipaddrv6 to identify packet type would be wrong, especially as + * further checks (that can cope with the "dynamic" case) are present inside + * the if block. So using $gateway['ipprotocol'] is the better option. + */ + if ($gateway['ipprotocol'] == "inet") { // This is an IPv4 gateway... $gwifip = find_interface_ip($gateway['interface'], true); if (!is_ipaddrv4($gwifip)) continue; //Skip this target @@ -178,7 +184,7 @@ EOD; mwexec("/sbin/route change -host " . escapeshellarg($gateway['monitor']) . " " . escapeshellarg($gateway['gateway']), true); } - } else if (is_ipaddrv6($gateway['gateway'])) { + } else if ($gateway['ipprotocol'] == "inet6") { // This is an IPv6 gateway... /* link locals really need a different src ip */ if(is_linklocal($gateway['gateway'])) { $gwifip = find_interface_ipv6_ll($gateway['interface'], true); |