diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-05-30 18:47:39 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-05-30 18:47:39 +0000 |
commit | 610b113684c4fb811a7b4a5cfd6d738ad9f127a5 (patch) | |
tree | 55450c092cc9192777ac1d2931264aa6a0996d1f | |
parent | fd4ce0e00b91d985e1248a3b58168aa5727ac5da (diff) | |
download | pfsense-610b113684c4fb811a7b4a5cfd6d738ad9f127a5.zip pfsense-610b113684c4fb811a7b4a5cfd6d738ad9f127a5.tar.gz |
* Add reset_carp()
* Utilizie reset_carp() after interface changes if need be
-rw-r--r-- | etc/inc/pfsense-utils.inc | 21 | ||||
-rwxr-xr-x | usr/local/www/interfaces.php | 2 | ||||
-rwxr-xr-x | usr/local/www/interfaces_lan.php | 2 | ||||
-rwxr-xr-x | usr/local/www/interfaces_opt.php | 2 | ||||
-rwxr-xr-x | usr/local/www/interfaces_wan.php | 2 |
5 files changed, 25 insertions, 4 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 24b8ef2..5035d46 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -37,6 +37,27 @@ function get_tmp_file() { return "/tmp/tmp-" . time(); } +/****f* pfsense-utils/reset_carp + * NAME + * reset_carp - resets carp after primary interface changes + * INPUTS + * null + * RESULT + * null + ******/ +function reset_carp() { + $carp_counter=find_number_of_created_carp_interfaces(); + mwexec("/sbin/sysctl net.inet.carp.allow=0"); + for($x=0; $x<$carp_counter; $x++) { + mwexec("/sbin/ifconfig carp{$x} down"); + mwexec("/sbin/ifconfig carp{$x} destroy"); + } + sleep(1); + mwexec("/sbin/sysctl net.inet.carp.allow=1"); + interfaces_carp_configure(); + interfaces_carp_bring_up_final(); +} + /****f* pfsense-utils/get_dns_servers * NAME * get_dns_servres - get system dns servers diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index d958cdf..2504c2a 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -705,7 +705,7 @@ if ($_POST) { interfaces_wan_configure(); - interfaces_carp_bring_up_final(); + reset_carp(); /* sync filter configuration */ filter_configure(); diff --git a/usr/local/www/interfaces_lan.php b/usr/local/www/interfaces_lan.php index 8d05668..8ad38db 100755 --- a/usr/local/www/interfaces_lan.php +++ b/usr/local/www/interfaces_lan.php @@ -261,7 +261,7 @@ if ($_POST['apply'] <> "") { interfaces_lan_configure(); - interfaces_carp_bring_up_final(); + reset_carp(); /* sync filter configuration */ filter_configure(); diff --git a/usr/local/www/interfaces_opt.php b/usr/local/www/interfaces_opt.php index 1f7e61b..626ccd0 100755 --- a/usr/local/www/interfaces_opt.php +++ b/usr/local/www/interfaces_opt.php @@ -429,7 +429,7 @@ if ($_POST) { interfaces_optional_configure_if($index); - interfaces_carp_bring_up_final(); + reset_carp(); /* load graphing functions */ enable_rrd_graphing(); diff --git a/usr/local/www/interfaces_wan.php b/usr/local/www/interfaces_wan.php index d958cdf..2504c2a 100755 --- a/usr/local/www/interfaces_wan.php +++ b/usr/local/www/interfaces_wan.php @@ -705,7 +705,7 @@ if ($_POST) { interfaces_wan_configure(); - interfaces_carp_bring_up_final(); + reset_carp(); /* sync filter configuration */ filter_configure(); |