summaryrefslogtreecommitdiff
path: root/scripts/vyatta-bridge.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/vyatta-bridge.pl')
-rwxr-xr-xscripts/vyatta-bridge.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/vyatta-bridge.pl b/scripts/vyatta-bridge.pl
index bb0d41c3..68d3e107 100755
--- a/scripts/vyatta-bridge.pl
+++ b/scripts/vyatta-bridge.pl
@@ -68,6 +68,14 @@ if ( $action eq 'SET' ) {
die "Error: Can not add interface $ifname with VRRP to bridge\n"
if (@vrrp);
+ $cfg->setLevel('interfaces pseudo-ethernet');
+ foreach my $peth ($cfg->listNodes()) {
+ my $link = $cfg->returnValue("$peth link");
+
+ die "Error: can not add interface $slave to bridge already used by pseudo-ethernet $peth\n"
+ if ($link eq $slave);
+ }
+
print "Adding interface $ifname to bridge $newbridge\n";
add_bridge_port($newbridge, $ifname, $cost, $priority);