Skip Menu |

This queue is for tickets about the Net-MAC CPAN distribution.

Report information
The Basics
Id: 50140
Status: resolved
Priority: 0/
Queue: Net-MAC

People
Owner: OLIVER [...] cpan.org
Requestors: guy.edwards [...] oucs.ox.ac.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: die option defect?
Date: Thu, 01 Oct 2009 10:51:50 +0100
To: bug-Net-MAC [...] rt.cpan.org
From: Guy Edwards <guy.edwards [...] oucs.ox.ac.uk>
Dear Oliver, short version: I think the 'die' => 0 option may have a defect. ...or I have missed something which is also possible. Long version: I have a script that uses Net::MAC to match against valid mac addresses I've have the problem that when feeding net::mac a known invalid mac address it's croaking the script instead of returning a failure, despite using the die=>0 setting. so I have my $submitted='00:1e:ob:57:5f:20'; # invalid o my $mac = Net::MAC->new('mac' => $formatted, 'die' => 0 ); if ( defined $mac ){ [...something...] } else { # hey I was given an # invalid MAC address } Which when fed with a known bad mac causes [error] [...] discovery of MAC address metadata failed, invalid characters in MAC address "00:1e:ob:57:5f:20" at foo-script line $foo ...which is correct but I don't want the page to die, I want to know they've submitted an invalid mac address and then tell them so via the script I tried verbose 1 as well with another invalid address: setting "die" to default value "1" setting "die" to "0" setting "mac" to "0018.6e49.4o4c" initialized object into class Net::MAC setting attribute "delimiter" to "." setting attribute "bit_group" to "16" Net::MAC detected an error: discovery of MAC address metadata failed, invalid characters in MAC address "0018.6e49.4o4c" Cheers Guy
Subject: Re: [rt.cpan.org #50140] die option defect?
Date: Wed, 21 Oct 2009 18:42:49 -0400
To: bug-Net-MAC [...] rt.cpan.org
From: Karl Ward <karlward [...] cpan.org>
I can't verify this behavior with my version of Perl (v5.8.8 built for i386-linux-thread-multi). Though unlikely, it could be tied to a particular version or build of Perl. Can you run: $ perl -v And send me the output? Also, put a note in the ticket containing the exact code you are running, because it could be something about the code you're using or the MAC address(es) used that triggers the bug. Or, better yet, if you're comfortable with CPAN and Test::More: 1. download the Net::MAC 1.5 distribution from the CPAN shell, or http://search.cpan.org/CPAN/authors/id/O/OL/OLIVER/Net-MAC-1.5.tar.gz 2. untar the code into a directory somewhere 3. write a Test::More test that triggers the bug 4. Send me/Oliver the relevant Test::More test On Thu, Oct 1, 2009 at 5:52 AM, Guy Edwards via RT <bug-Net-MAC@rt.cpan.org>wrote: Show quoted text
> Thu Oct 01 05:52:23 2009: Request 50140 was acted upon. > Transaction: Ticket created by guy.edwards@oucs.ox.ac.uk > Queue: Net-MAC > Subject: die option defect? > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: guy.edwards@oucs.ox.ac.uk > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=50140 > > > > Dear Oliver, > > short version: > I think the 'die' => 0 option may have a defect. > ...or I have missed something which is also possible. > > Long version: > > I have a script that uses Net::MAC to match against valid mac addresses > > I've have the problem that when feeding net::mac a known invalid mac > address it's croaking the script instead of returning a failure, despite > using the die=>0 setting. > > so I have > > my $submitted='00:1e:ob:57:5f:20'; # invalid o > my $mac = Net::MAC->new('mac' => $formatted, 'die' => 0 ); > if ( defined $mac ){ > [...something...] > } > else { > # hey I was given an > # invalid MAC address > } > > Which when fed with a known bad mac causes > [error] [...] discovery of > MAC address metadata failed, invalid characters in MAC address > "00:1e:ob:57:5f:20" at foo-script line $foo > > ...which is correct but I don't want the page to die, I want to know > they've submitted an invalid mac address and then tell them so via the > script > > I tried verbose 1 as well with another invalid address: > > setting "die" to default value "1" setting "die" to "0" setting "mac" to > "0018.6e49.4o4c" initialized object into class Net::MAC setting > attribute "delimiter" to "." setting attribute "bit_group" to "16" > Net::MAC detected an error: discovery of MAC address metadata failed, > invalid characters in MAC address "0018.6e49.4o4c" > > Cheers > Guy > >
-- Karl Ward http://ghostghost.net
Hi, On Thu Oct 01 05:52:23 2009, guy.edwards@oucs.ox.ac.uk wrote: Show quoted text
> short version: > I think the 'die' => 0 option may have a defect. > ...or I have missed something which is also possible.
Likewise to Karl, I'm afraid I can't reproduce this bug either on my systems. I'll resolve this ticket but please get back to us if you feel there is an underlying issue - otherwise we assume you've located the local cause. -- regards, oliver.