From a4e2faa36779c7749ed997748c63a1ad4fa56c31 Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Sun, 18 Oct 2015 21:36:00 +0100 Subject: 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 --- scripts/vyatta-bridge.pl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') 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; -- cgit v1.2.3