diff --git a/Changes b/Changes index fe8eacb..f2f3a8c 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for {{$dist->name}} {{$NEXT}} + - fix ICMP and ICMPv6 destinaton unreachable parsing 0.004000 2018-01-24 09:09:21+01:00 Europe/Vienna - add ping vs. raw socket advantages to ICMP and ICMPv6 documentation diff --git a/lib/Net/Async/Ping/ICMP.pm b/lib/Net/Async/Ping/ICMP.pm index 392bb79..f68c414 100644 --- a/lib/Net/Async/Ping/ICMP.pm +++ b/lib/Net/Async/Ping/ICMP.pm @@ -160,7 +160,7 @@ sub _parse_icmp_packet { # 8 byte is the length of the ICMP Destination # unreachable header raw => substr($recv_msg, $offset + 8) - ); + )->unpack; # skip if contained packet isn't an icmp packet return if $ipv4->protocol != NF_IPv4_PROTOCOL_ICMPv4; diff --git a/lib/Net/Async/Ping/ICMPv6.pm b/lib/Net/Async/Ping/ICMPv6.pm index 5edebda..3c3915b 100644 --- a/lib/Net/Async/Ping/ICMPv6.pm +++ b/lib/Net/Async/Ping/ICMPv6.pm @@ -162,7 +162,7 @@ sub _parse_icmpv6_packet { # 8 byte is the length of the ICMPv6 destination # unreachable header raw => substr($recv_msg, $offset + 8) - ); + )->unpack; # skip if contained packet isn't an ICMPv6 packet return if $ipv6->protocol != NF_IPv6_PROTOCOL_ICMPv6;