From 75f2c22ccc5e30241722e57abd8af534a980ac12 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 10 Aug 2005 15:25:16 +0000 Subject: Remove any dangling carp occurances. This bug showed its head during the hackathon. --- etc/inc/interfaces.inc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'etc/inc/interfaces.inc') diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index e0fd8b2..998fbd1 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -310,6 +310,7 @@ function interfaces_carp_configure() { unlink_if_exists("/usr/local/pkg/pf/carp_rules.sh"); $carp_instances_counter = 0; $pfsync_instances_counter = 0; + $total_carp_interfaces_defined = find_number_of_created_carp_interfaces(); if (is_array($config['virtualip']['vip'])) { if(is_array($config['installedpackages']['carpsettings']['config'])) { foreach($config['installedpackages']['carpsettings']['config'] as $carp) @@ -360,6 +361,11 @@ function interfaces_carp_configure() { } } } + /* remove any dangling carp references */ + for($x=$carp_instances_counter; $x<$total_carp_interfaces_defined; $x++) { + mwexec("/sbin/ifconfig carp{$x} down"); + mwexec("/sbin/ifconfig carp{$x} destroy"); + } unmute_kernel_msgs(); if ($g['booting']) { unmute_kernel_msgs(); -- cgit v1.1