diff options
author | Ermal <eri@pfsense.org> | 2014-11-10 23:32:27 +0100 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2014-11-10 23:32:27 +0100 |
commit | f4443dce5434f465a16dad16c7ea31016c01625d (patch) | |
tree | bdc2b596d06f36591689ded6e63016491b61f2b5 /etc/inc/gwlb.inc | |
parent | d87fcac96b45958bd777c7ac38cc0665dbde6062 (diff) | |
download | pfsense-f4443dce5434f465a16dad16c7ea31016c01625d.zip pfsense-f4443dce5434f465a16dad16c7ea31016c01625d.tar.gz |
Compare the right things here.
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r-- | etc/inc/gwlb.inc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index e0d4c2d..e1d1e63 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -194,6 +194,8 @@ EOD; if ($gateway['monitor'] == $gateway['gateway']) { /* link locals really need a different src ip */ if (is_linklocal($gateway['gateway'])) { + if (!strpos($gateway['gateway'])) + $gateway['gateway'] .= '%' . $gateway['interface']; $gwifip = find_interface_ipv6_ll($gateway['interface'], true); } else { $gwifip = find_interface_ipv6($gateway['interface'], true); @@ -208,9 +210,9 @@ EOD; } /* Make sure srcip and target have scope defined when they are ll */ - if (is_linklocal($gwifip) && !strstr($gwifip, '%')) + if (is_linklocal($gwifip) && !strpos($gwifip, '%')) $gwifip .= '%' . $gateway['interface']; - if (is_linklocal($gateway['monitor']) && !strstr($gateway['monitor'], '%')) + if (is_linklocal($gateway['monitor']) && !strpos($gateway['monitor'], '%')) $gateway['monitor'] .= "%{$gateway['interface']}"; if (!is_ipaddrv6($gwifip)) @@ -222,7 +224,7 @@ EOD; * Add static routes for each gateway with their monitor IP * not strictly necessary but is a added level of protection. */ - if (is_ipaddrv6($gateway['gateway']) && $gateway['monitor'] != $gateway['gateway']) { + if ($gateway['gateway'] != $gateway['monitor']) { log_error("Removing static route for monitor {$gateway['monitor']} and adding a new route through {$gateway['gateway']}"); mwexec("/sbin/route change -host -inet6 " . escapeshellarg($gateway['monitor']) . " " . escapeshellarg($gateway['gateway']), true); |