Commit ea04c083 authored by Kirk Webb's avatar Kirk Webb

snmpit: further propagate special vlan arguments (e.g., OF-enabled)

There were cases where special vlan arguments were not making it to
createVlan() calls internal to other calls in the snmpit_stack module.
Stash these special arguments where such calls can access them.
parent d0550932
......@@ -106,6 +106,11 @@ sub new($$$@) {
$self->{PRUNE_VLANS} = 1;
$self->{VTP} = 0;
#
# A place to stash special VLAN arguments
#
$self->{VLAN_SPECIALARGS} = {};
# must do this before spawning each device object, which forks().
bless($self,$class);
......@@ -366,18 +371,16 @@ sub setPortVlan($$@) {
}
} else {
#
# Check to see if we had any special arguments saved up for
# this VLAN
# Grab any special arguments saved up for this VLAN.
# The value may be undefined. That's OK since the
# "otherargs" argument is an optional parameter.
#
my @otherargs = ();
if (exists $self->{VLAN_SPECIALARGS}{$vlan_id}) {
@otherargs = @{$self->{VLAN_SPECIALARGS}{$vlan_id}}
}
my $otherargs = $self->{VLAN_SPECIALARGS}->{$vlan_id};
#
# Create the VLAN
#
my $res = $dev->createVlan($vlan_id,$vlan_number);
my $res = $dev->createVlan($vlan_id,$vlan_number,$otherargs);
if ($res == 0) {
warn "Error: Failed to create VLAN $vlan_id ($vlan_number)".
" on $switch\n";
......
......@@ -2075,6 +2075,9 @@ sub CreateOneVlan($$$@)
return 1;
}
$otherargs{"ofenabled"} = 1;
# XXX: Some internal calls to snmpit_stack::createVlan()
# still need to get special vlan arguments this way.
$stack->{VLAN_SPECIALARGS}->{$vlanid}->{"ofenabled"} = 1;
}
my $vlan_number = $stack->createVlan($vlanid, $vlanid,
......
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