PacketFence - BTS - PacketFence
View Issue Details
0001441PacketFencecorepublic2012-05-02 15:292015-02-13 15:42
obilodeau 
 
normaltweaksometimes
closedopen 
 
 
0001441: warnings in pfsetvlan when a switch's mode=... is not set
Warning is "Use of uninitialized value in string eq at /usr/local/pf/sbin/pfsetvlan line 626" in logs/packetfence.log

if ( $config{$switch_ip}{'mode'} eq 'ignore' ) {
    $logger->info("We have received a trap from switch $switch_ip. This switch is in 'ignore' 
mode. Flush the trap");
    return;
}


I think warning happens on switches that don't have an explicit mode=... for their own instance and rely on the default inherited value instead.

Fix: the $config hash should hold default values too or switchFactory should provide a higher-level construct to verify the mode and that the switch exists. Grabbing %{ $switchFactory->{_config} } is probably expensive on large conf/switches.conf anyways.

Seen on 3.3.2 but probably present since ages.
No tags attached.
Issue History
2012-05-02 15:29obilodeauNew Issue
2015-02-13 15:42lmunroNote Added: 0003800
2015-02-13 15:42lmunroStatusnew => closed

Notes
(0003800)
lmunro   
2015-02-13 15:42   
These bugs have been sitting untouched since 2012.
Closing them and possibly reopening in github tracker where relevant.