diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-18 13:08:58 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-18 13:08:58 -0800 |
commit | 408b00b6b3caf284592f561fbf6bc5a04a163187 (patch) | |
tree | 802296110b251b54bb8e7fbc7c33eed7ab71bb30 /scripts/vyatta-bridge.pl | |
parent | 6ec63ce719500b97423975e2488c605f44d8b644 (diff) | |
download | vyatta-cfg-quagga-408b00b6b3caf284592f561fbf6bc5a04a163187.tar.gz vyatta-cfg-quagga-408b00b6b3caf284592f561fbf6bc5a04a163187.zip |
Add more checks for bridge/bond conflicts
Don't allow putting bridge port into bond-group (and vice-versa).
Diffstat (limited to 'scripts/vyatta-bridge.pl')
-rw-r--r-- | scripts/vyatta-bridge.pl | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/vyatta-bridge.pl b/scripts/vyatta-bridge.pl index 356361a2..fd5fad8a 100644 --- a/scripts/vyatta-bridge.pl +++ b/scripts/vyatta-bridge.pl @@ -55,23 +55,26 @@ my $cost = $cfg->returnValue('bridge-group cost'); my $priority = $cfg->returnValue('bridge-group priority'); if ( $action eq 'SET' ) { - die "Error: $ifname: not in a bridge-group.\n" unless $newbridge; + die "Error: $ifname: not in a bridge-group\n" unless $newbridge; + + die "Error: can not add interface $ifname that is part of bond-group to bridge\n" + if defined($cfg->returnValue('bond-group')); my @address = $cfg->returnValues('address'); - die "Error: Can not add interface $ifname with addresses to bridge.\n" + die "Error: Can not add interface $ifname with addresses to bridge\n" if (@address); - print "Adding interface $ifname to bridge $newbridge.\n"; + print "Adding interface $ifname to bridge $newbridge\n"; add_bridge_port($newbridge, $ifname, $cost, $priority); } elsif ( $action eq 'DELETE' ) { - die "Error: $ifname: not in a bridge-group.\n" unless $oldbridge; + die "Error: $ifname: not in a bridge-group\n" unless $oldbridge; - print "Removing interface $ifname from bridge $oldbridge.\n"; + print "Removing interface $ifname from bridge $oldbridge\n"; remove_bridge_port($oldbridge, $ifname); } elsif ($oldbridge ne $newbridge) { - print "Moving interface $ifname from $oldbridge to $newbridge.\n"; + print "Moving interface $ifname from $oldbridge to $newbridge\n"; remove_bridge_port($oldbridge, $ifname); add_bridge_port($newbridge, $ifname, $cost, $priority); } |