in reply to Invalid ICMP type 69

I'm far from a pack/unpack expert, but isn't the ICMP type only one byte?

Yup, it is.

I'd suggest taking another look at your unpack templates, perhaps.


Mike

Replies are listed 'Best First'.
Re^2: Invalid ICMP type 69
by vancetech (Beadle) on Nov 03, 2006 at 20:51 UTC
    After looking at Net::Ping I can see that the received ICMP packet type data starts 20 bytes into the packet. The following code sucessfully unpacks the ICMP Type and Sub-Code.
    my($fromtype, $fromsubcode) = unpack("C2", substr($icmpbuffer, 20, 2) +);
    Likewise, the NetPacket::ICMP->decode() function requires the same section of the packet and not the full packet that is returned. I wonder what the first portion of the packet is.