summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-05-30 18:47:39 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-05-30 18:47:39 +0000
commit610b113684c4fb811a7b4a5cfd6d738ad9f127a5 (patch)
tree55450c092cc9192777ac1d2931264aa6a0996d1f
parentfd4ce0e00b91d985e1248a3b58168aa5727ac5da (diff)
downloadpfsense-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.inc21
-rwxr-xr-xusr/local/www/interfaces.php2
-rwxr-xr-xusr/local/www/interfaces_lan.php2
-rwxr-xr-xusr/local/www/interfaces_opt.php2
-rwxr-xr-xusr/local/www/interfaces_wan.php2
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();
OpenPOWER on IntegriCloud