diff options
author | Mohit Mehta <mohit.mehta@vyatta.com> | 2010-02-18 17:11:35 -0800 |
---|---|---|
committer | Mohit Mehta <mohit.mehta@vyatta.com> | 2010-02-18 17:11:35 -0800 |
commit | fab23c4e4b7e5566e43ccbaa9f4dbc7d1b60fc69 (patch) | |
tree | 6f575f9aaf66f266315c00155d5c930fa1af995e /templates/interfaces/ethernet | |
parent | 8989b47af4fbf6c980003dfe6b721130044b0d6a (diff) | |
download | vyatta-cfg-system-fab23c4e4b7e5566e43ccbaa9f4dbc7d1b60fc69.tar.gz vyatta-cfg-system-fab23c4e4b7e5566e43ccbaa9f4dbc7d1b60fc69.zip |
Fix Bug 5064 can't delete bridge group and membership in one commit
* fix this for eth, eth.vif, bond, bond.vif interfaces
* also, bridge-group code for bonding interfaces wasn't changed
with commit ec080f99 that re-strucutred bridging code in eth and
eth.vifs to fix bug 4708. bridge-group code for bond and bond.vif
interfaces is now similar to the fix for 4708
Diffstat (limited to 'templates/interfaces/ethernet')
-rw-r--r-- | templates/interfaces/ethernet/node.tag/bridge-group/node.def | 20 | ||||
-rw-r--r-- | templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def | 20 |
2 files changed, 36 insertions, 4 deletions
diff --git a/templates/interfaces/ethernet/node.tag/bridge-group/node.def b/templates/interfaces/ethernet/node.tag/bridge-group/node.def index b30a9e10..7590dc96 100644 --- a/templates/interfaces/ethernet/node.tag/bridge-group/node.def +++ b/templates/interfaces/ethernet/node.tag/bridge-group/node.def @@ -22,7 +22,17 @@ end: fi elif [ ${COMMIT_ACTION} = 'DELETE' ]; then echo "Removing interface $ethif from bridge $oldbridge." - sudo brctl delif $oldbridge $ethif + if /opt/vyatta/sbin/vyatta-bridgegroup-depedency.pl \ + --bridge-notin-proposedcfg \ + --bridge-interface="$oldbridge"; then \ + # this is the case where the bridge that this interface is assigned + # to is getting deleted in the same commit as the bridge node under + # this interface - Bug 5064|4734. Since bridge has a higher priority; + # it gets deleted before the removal of bridge-groups under interfaces + exit 0 + else + sudo brctl delif $oldbridge $ethif + fi else if [ -z "$newbridge" ]; then echo "Must specify bridge name." @@ -30,7 +40,13 @@ end: else if [ "$oldbridge" != "$newbridge" ]; then echo "Removing interface $ethif from bridge $oldbridge and adding it to $newbridge." - sudo brctl delif $oldbridge $ethif + # do not remove interface from bridge if bridge not in proposed config + # reason is same as mentioned in the ${COMMIT_ACTION} = 'DELETE' section + if ! /opt/vyatta/sbin/vyatta-bridgegroup-depedency.pl \ + --bridge-notin-proposedcfg \ + --bridge-interface="$oldbridge"; then \ + sudo brctl delif $oldbridge $ethif + fi sudo brctl addif $newbridge $ethif fi if [ -n "$VAR(./cost/@)" ]; then diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def index e3645b1c..dd3863a0 100644 --- a/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def +++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def @@ -25,7 +25,17 @@ end: fi elif [ ${COMMIT_ACTION} = 'DELETE' ]; then echo "Removing interface $ethif from bridge $oldbridge." - sudo brctl delif $oldbridge $ethif + if /opt/vyatta/sbin/vyatta-bridgegroup-depedency.pl \ + --bridge-notin-proposedcfg \ + --bridge-interface="$oldbridge"; then \ + # this is the case where the bridge that this interface is assigned + # to is getting deleted in the same commit as the bridge node under + # this interface - Bug 5064|4734. Since bridge has a higher priority; + # it gets deleted before the removal of bridge-groups under interfaces + exit 0 + else + sudo brctl delif $oldbridge $ethif + fi else if [ -z "$newbridge" ]; then echo "Must specify bridge name." @@ -33,7 +43,13 @@ end: else if [ "$oldbridge" != "$newbridge" ]; then echo "Removing interface $ethif from bridge $oldbridge and adding it to $newbridge." - sudo brctl delif $oldbridge $ethif + # do not remove interface from bridge if bridge not in proposed config + # reason is same as mentioned in the ${COMMIT_ACTION} = 'DELETE' section + if ! /opt/vyatta/sbin/vyatta-bridgegroup-depedency.pl \ + --bridge-notin-proposedcfg \ + --bridge-interface="$oldbridge"; then \ + sudo brctl delif $oldbridge $ethif + fi sudo brctl addif $newbridge $ethif fi if [ -n "$VAR(./cost/@)" ]; then |