Open thesalmon opened 7 years ago
After that an ECHO Reply ICMPv6 message is being processed the callback is called in this way:
n->callback(&sender, ttl, (uint8_t *)&UIP_ICMP_BUF[sizeof(struct uip_icmp_hdr)], uip_len - sizeof(struct uip_icmp_hdr) - UIP_IPH_LEN);
However the index sizeof(struct uip_icmp_hdr) in UIP_ICMP_BUF does not point to the beginning of the ICMPv6 payload, due to the definition of UIP_ICMP_BUF:
sizeof(struct uip_icmp_hdr)
UIP_ICMP_BUF
#define UIP_ICMP_BUF ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
If I'm not wrong the following should fix it:
n->callback(&sender, ttl, &((uint8_t *)UIP_ICMP_BUF)[sizeof(struct uip_icmp_hdr)], uip_len - sizeof(struct uip_icmp_hdr) - UIP_IPH_LEN);
After that an ECHO Reply ICMPv6 message is being processed the callback is called in this way:
However the index
sizeof(struct uip_icmp_hdr)
inUIP_ICMP_BUF
does not point to the beginning of the ICMPv6 payload, due to the definition ofUIP_ICMP_BUF
: