Commit a699e693 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

When creating a vlan by hand, we usually look at the ports and if they

are in another vlan already, they are yanked out. Change this to check
if the port is tagged; if the port is tagged then assume the user
really does want the ports in multiple vlans.
parent 23b26b73
......@@ -3158,7 +3158,13 @@ sub doMakeVlan($$@) {
my $vlan = VLan->FindVlanByPort(undef, $port);
if (defined($source_vlan) && !$vlan->SameVlan($source_vlan)) {
die("Ports must be in a single vlan\n");
if (IsPortTagged($port)) {
print "$port is tagged and already in $source_vlan. ".
"But doing it anyway!\n";
}
else {
die("Ports must be in a single vlan\n");
}
}
$source_vlan = $vlan;
}
......@@ -3312,8 +3318,12 @@ sub doMakeVlan($$@) {
$source_vlan->ClrSwitchPath();
}
# Yank the ports out of the old vlan now.
# Yank the ports out of the old vlan now, unless it is tagged,
# cause we assume the user knows what they want.
foreach my $port (@ports) {
next
if (IsPortTagged($port));
if ($source_vlan->DelPort($port)) {
print STDERR "Could not yank $port from $source_vlan\n";
goto bad;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment