Subject: | Bug in "fetch_oui_from_cache"; Possible fix included |
Date: | Mon, 17 Aug 2009 15:38:45 +0100 |
To: | bug-Net-MAC-Vendor [...] rt.cpan.org |
From: | Lee Heagney <lee [...] ee.ucl.ac.uk> |
Brian,
I'm using the VERY useful Net::MAC::Vendor module (thanks for making
this available), but I have just ran into a problem which causes it to hang.
I've tested this using:
Dist: Net-MAC-Vendor-1.18
OS: CentOS Linux (5.3) 2.6.18-128.2.1.el5 #1 SMP x86_64 GNU/Linux
Perl: 5.8.8 (Custom built, not the CentOS distributed perl)
MAC: 05:25:05:7b:6a:b2
After a swift bit of investigation it seems to be a problem with the
"fetch_oui_from_cache" function (I am loading the oui data from a local
file).
When I use a valid MAC address, this works as normal, but if I use a MAC
address that is not found in the oui datafile (i.e 05:25:05:7b:6a:b2),
this function call hangs and never returns.
There is probably a more elegant way to do this, but this is fixed if I
replace line 225:
exists $Cached->{ $mac } ? $Cached->{ $mac } : ();
with
exists $Cached->{ $mac } ? $Cached->{ $mac } : [];
I've also tested the original module on Solaris 9 (Generic_122300-26
sun4u sparc SUNW,Ultra-2), using perl 5.8.7 and it doesn't seem to have
this bug. The fix described above also seems to behave as expected on
this solaris/perl combination.
If you need any more info then please get in touch.
Cheers,
Lee.
**********************************************
Lee Heagney
System administrator
Dept Electronic & Electrical Engineering
University College London
Torrington Place
London TEL 020 7679 3960
WC1E 7JE FAX 020 7388 9325