Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Of Net::Arp and Hashes

by idsfa (Vicar)
on Jan 13, 2006 at 18:51 UTC ( [id://523063]=note: print w/replies, xml ) Need Help??


in reply to Of Net::Arp and Hashes

Reading the C code, it appears to be doing an insanely overblown grep on /proc/net/arp. On bsd, the code reads the routing table from the system. Neither method actually performs an ARP.

The most likely reason I can see for the behaviour you are seeing is this chunk of code:

if(strlen(mac) > 0) strcpy(mac,"unkown"); else return -1;

The subroutine is supposed to look up an unknown mac, but I read this as exiting without setting the value if your initial guess is of zero length. I'm not good enough at XS to decipher that, but it looks as if your original guess is discarded and an unintialized buffer is passed in instead, so it may not be fixable without altering the code.

Given these two, I'd recommend ditching this module. You might want to look at arp-request.pl in the Net::Packet package.

Updated: Or, just read japhy saying the same thing, but earlier. :-þ Way to blow my 200th node.


The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon

Replies are listed 'Best First'.
Re^2: Of Net::Arp and Hashes
by cmilfo (Hermit) on Jan 13, 2006 at 19:05 UTC

    I'll give Net::Packet a try; a true ARP request would be ideal, anyway. Thank you.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://523063]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-19 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found