Commit fee57b6e authored by Kirk Webb's avatar Kirk Webb

Disable OpenFlow when removing stale vlans in SyncVlansFromTables()

If OF is specified for a vlan, and the sync operation is going to
remove it because it is stale, try to disable OF before removal.
parent cda9ed7a
...@@ -2426,6 +2426,19 @@ sub syncVlansFromTables($$@) { ...@@ -2426,6 +2426,19 @@ sub syncVlansFromTables($$@) {
$stack->removeSomePortsFromTrunk($vlanid, @trunkports) $stack->removeSomePortsFromTrunk($vlanid, @trunkports)
or goto bad; or goto bad;
} }
# Disable OpenFlow, if set for vlan
my $vlan = VLan->Lookup($vlanid);
if ($vlan) {
my $ofenabled;
$vlan->GetAttribute("ofenabled",\$ofenabled);
if (defined($ofenabled) && $ofenabled == 1) {
if (!$stack->disableOpenflow($vlanid)) {
print STDERR "Could not disable openflow ".
"on stale vlan: $vlanid\n";
goto bad;
}
}
}
if (!$stack->removeVlan($vlanid)) { if (!$stack->removeVlan($vlanid)) {
print STDERR "Could not remove vlan: $vlanid\n"; print STDERR "Could not remove vlan: $vlanid\n";
goto bad; goto bad;
......
Markdown is supported
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