in reply to Of Net::Arp and Hashes
Then I ran this:char * arp_lookup(dev, ip, mac) unsigned char *dev; unsigned char *ip; unsigned char *mac; CODE: char tmp[20]; printf("TMP(%d) IS %s\n", strlen(tmp), tmp); if(SOCK_TYPE == SOCK_RAW) { arp_lookup_bsd(dev,ip,tmp); } else { arp_lookup_linux(dev,ip,tmp); } mac = tmp; OUTPUT: mac
I get this as output:#!/usr/bin/perl use Net::ARP; my $mac = ""; Net::ARP::arp_lookup(eth1 => '172.18.0.1', $mac); print "mac=$mac\n"; Net::ARP::arp_lookup(eth1 => '172.18.0.1', $mac); print "mac=$mac\n";
The simple fix is change char tmp[20]; to char tmp[20] = "unknown";. I will be sending a bug report to the author.TMP(0) IS mac= TMP(8) IS pï¿ï¿½ï¿½ mac=00:0E:D7:80:37:20
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Of Net::Arp and Hashes
by cmilfo (Hermit) on Jan 13, 2006 at 19:18 UTC | |
by japhy (Canon) on Jan 13, 2006 at 20:12 UTC | |
by idsfa (Vicar) on Jan 14, 2006 at 03:46 UTC |