in reply to Network/Netmask returned by Net::Pcap's lookupnet
I've tried inet_ntoa and friends
Presumably you have lost the Network byte packing somewhere because there is no problem converting your quoted integers into realistic dot quads.....
my $addr = pack "N", -1062731776; my $mask = pack "N", -256; use Socket; print inet_ntoa($addr),"/",inet_ntoa($mask),"\n"; sub perl_ntoa { join ".", unpack( "C4", $_[0] ) } print perl_ntoa($addr),"/",perl_ntoa($mask),"\n"; __DATA__ 192.168.0.0/255.255.255.0 192.168.0.0/255.255.255.0
cheers
tachyon
|
|---|