summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-10-18 21:36:00 +0100
committerAlex Harpin <development@landsofshadow.co.uk>2015-10-18 21:36:00 +0100
commita4e2faa36779c7749ed997748c63a1ad4fa56c31 (patch)
tree85952c3e664572a4363b3451760d9e6df1306ec1 /scripts
parent62853e5688440254058adba768fa8a04b8bbc27e (diff)
downloadvyatta-cfg-system-a4e2faa36779c7749ed997748c63a1ad4fa56c31.tar.gz
vyatta-cfg-system-a4e2faa36779c7749ed997748c63a1ad4fa56c31.zip
vyatta-cfg-system: ensure bridge slaves are deletable from bridges
Due to previous refactoring of the bridge management code, it was possible to get the system and config in an inconsistent state by the following actions. set interfaces bridge br1 set interfaces bridge br1 address '192.168.1.1/24' set interfaces ethernet eth0 bridge-group bridge 'br1' commit delete interfaces ethernet eth0 bridge-group bridge 'br1' commit This would result in the config still containing the bridge-group settings, but the actual bridge would be missing eth0 in br1, breaking any further attempts to configure the bridge without manual intervention. Bug #476 http://bugzilla.vyos.net/show_bug.cgi?id=476
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-bridge.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/vyatta-bridge.pl b/scripts/vyatta-bridge.pl
index 35b28fc9..a777b843 100755
--- a/scripts/vyatta-bridge.pl
+++ b/scripts/vyatta-bridge.pl
@@ -54,6 +54,10 @@ my $newbridge = $cfg->returnValue('bridge-group bridge');
my $cost = $cfg->returnValue('bridge-group cost');
my $priority = $cfg->returnValue('bridge-group priority');
+if (!defined($newbridge) && ($action ne 'SET')) {
+ $action = 'DELETE';
+}
+
if ($action eq 'SET') {
die "Error: $ifname: not in a bridge-group\n" unless $newbridge;