Commit 645a8bd3 authored by Robert Ricci's avatar Robert Ricci
Browse files

Fix for parallelized snmpit stack

The parallelization code in the stack module puts the devices in
child processes, which means that when they lookup their allowed
VLAN ranges, they can no longer update the value in the parent
stack object (which is in a different process). So, we have to do
it here too.
parent a8a32a62
......@@ -1373,6 +1373,11 @@ sub create($$$$) {
my $self = { NAME => $name, TYPE => $type,
PARENT => $parent, DEBUG => $parent->{DEBUG}};
if ($parent->{DEBUG} && !$jitdev_dumper) { $jitdev_dumper = new Dumpvalue; }
# The device options get recorded in the fork,
# so we have to do them here too (so we can fish out # min and max vlan)
my $options = snmpit_lib::getDeviceOptions($name);
$self->{MIN_VLAN} = $options->{'min_vlan'} if ($options);
$self->{MAX_VLAN} = $options->{'max_vlan'} if ($options);
bless ($self, $class);
$devices{$name} = $self;
$self->spawn() if ($snmpit_stack::parallelized);
Markdown is supported
0% or .
Finish editing this message first!
Please register or to comment