I experience strange issue on Windows 7 when receiving ICMPv6 echo replies using ASIO-BOOST library. The received data is missing the IP header, it only has the ICMP header and the payload. Some more details below:
//IPv4
replyBuffer.consume(replyBuffer.size());
mySocketIPv4->async_receive(replyBuffer.prepare(65575),..);
--packet received--
replyBuffer.commit(length);
std::istream istr(&replyBuffer);
icmp_header icmp_hdr;
ipv4_header ipv4_hdr
istr >> ipv4_hdr >> icmp_hdr;
Note: The data received has IP header as well
//IPv6
replyBuffer.consume(replyBuffer.size());
mySocketIPv6->async_receive(replyBuffer.prepare(65575),..);
--packet received--
replyBuffer.commit(length);
std::istream istr(&replyBuffer);
icmp_header icmp_hdr;
ipv6_header ipv6_hdr
//istr >> ipv6_hdr >> icmp_hdr; - works on Linux only
istr >> icmp_hdr;
Note: The data has ICMPv6 header only and payload. On Linux, however, the data starts with the IP header following the ICMPv6 header and the payload.
I need to get some information like TTL, source IP etc from the IP header when I receive the echo reply. How can I access the IP header data in this case?
Your help is very much appreciated!