summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-04-14 14:52:50 -0400
committerjim-p <jimp@pfsense.org>2012-04-14 14:53:59 -0400
commit711a20ebcbddc6afd295140faad40aa26459cdf4 (patch)
tree9ccc4a6734a7eda0132bdaad4143dbcdaaac3a91
parentd86ef65fa4b2b79301c7fd992901750a05ffe869 (diff)
downloadpfsense-711a20ebcbddc6afd295140faad40aa26459cdf4.zip
pfsense-711a20ebcbddc6afd295140faad40aa26459cdf4.tar.gz
Some IPv6 fixes for gateway groups
-rw-r--r--etc/inc/gwlb.inc21
1 files changed, 18 insertions, 3 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index abe0dc7..98087c2 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -234,7 +234,12 @@ EOD;
*/
if (is_ipaddr($gateway['gateway']) && $gateway['monitor'] != $gateway['gateway']) {
log_error(sprintf(gettext('Removing static route for monitor %1$s and adding a new route through %2$s'), $gateway['monitor'], $gateway['gateway']));
- mwexec("/sbin/route change -host " . escapeshellarg($gateway['monitor']) .
+ if(is_ipaddrv6($gateway['gateway'])) {
+ $inetfamily = "-inet6";
+ } else {
+ $inetfamily = "-inet";
+ }
+ mwexec("/sbin/route change {$inetfamily} -host " . escapeshellarg($gateway['monitor']) .
" " . escapeshellarg($gateway['gateway']), true);
}
@@ -588,12 +593,22 @@ function return_gateway_groups_array() {
$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!");
- mwexec("/sbin/route change -inet default {$gateways_arr[$upgw]['gateway']}");
+ if(is_ipaddrv6($gateways_arr[$upgw]['gateway'])) {
+ $inetfamily = "-inet6";
+ } else {
+ $inetfamily = "-inet";
+ }
+ mwexec("/sbin/route change {$inetfamily} default {$gateways_arr[$upgw]['gateway']}");
}
} else {
$defaultgw = trim(`/sbin/route -n get -inet default | /usr/bin/grep gateway | /usr/bin/sed 's/gateway://g'`, " \n");
+ if(is_ipaddrv6($gateways_arr[$dfltgwname]['gateway'])) {
+ $inetfamily = "-inet6";
+ } else {
+ $inetfamily = "-inet";
+ }
if ($defaultgw != $gateways_arr[$dfltgwname]['gateway'])
- mwexec("/sbin/route change -inet default {$gateways_arr[$dfltgwname]['gateway']}");
+ mwexec("/sbin/route change {$inetfamily} default {$gateways_arr[$dfltgwname]['gateway']}");
}
unset($upgw, $dfltgwfound, $dfltgwdown, $gwname, $gwsttng);
OpenPOWER on IntegriCloud