summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/vyatta-bonding.pl3
-rw-r--r--scripts/vyatta-bridge.pl15
2 files changed, 12 insertions, 6 deletions
diff --git a/scripts/vyatta-bonding.pl b/scripts/vyatta-bonding.pl
index be09e754..fe07b1a2 100755
--- a/scripts/vyatta-bonding.pl
+++ b/scripts/vyatta-bonding.pl
@@ -196,6 +196,9 @@ sub commit_check {
die "Error: can not add disabled interface $slave to bond-group $intf\n"
if $cfg->exists('disable');
+ die "Error: can not add interface $slave that is part of bridge to bond-group\n"
+ if defined($cfg->returnValue("bridge-group bridge"));
+
my @addr = $cfg->returnValues('address');
die "Error: can not add interface $slave with addresses to bond-group\n"
if (@addr);
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);
}