diff options
author | Chris Buechler <cmb@pfsense.org> | 2008-12-08 02:31:36 +0000 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2008-12-08 02:31:36 +0000 |
commit | 2f6f9dc381fee47735b8fdf2bcad02ca12540f6e (patch) | |
tree | 7651b40dbb1f4b4d1a68cb1c0f7623be3878ab50 | |
parent | 839de3f1dc59f6533ec30fc9eac1bf898a57cdbc (diff) | |
download | pfsense-2f6f9dc381fee47735b8fdf2bcad02ca12540f6e.zip pfsense-2f6f9dc381fee47735b8fdf2bcad02ca12540f6e.tar.gz |
fix CARP panics with VLANs
-rw-r--r-- | etc/inc/interfaces.inc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 1621a29..c305910 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -68,7 +68,18 @@ function interface_vlan_configure($if, $tag, $vlanif = "") { mwexec("/sbin/ifconfig " . escapeshellarg($if) . " up vlanhwtag vlanmtu"); if ($g['booting'] || !(empty($vlanif))) { - mwexec("/sbin/ifconfig {$vlanif} destroy", true); + /* before destroying, see if CARP is in use + If an interface containing an active CARP IP is destroyed, + the CARP interface will hang in INIT and must be destroyed + itself before it will function again (which causes a panic). + Trying to configure a CARP interface stuck in INIT will + cause a panic as well. -cmb + */ + $carpcount = find_number_of_needed_carp_interfaces(); + /* will continue to destroy VLANs where CARP is not in use + to retain previous behavior and avoid regressions */ + if($carpcount < 1) + mwexec("/sbin/ifconfig {$vlanif} destroy"); mwexec("/sbin/ifconfig {$vlanif} create"); } else $vlanif = exec("/sbin/ifconfig vlan create"); |