uip_icmp6_error_output: remove and add RPL ext header instead of inverting it, so that the payload of the returned ICMP error matches the original packet

This commit is contained in:
Simon Duquennoy 2016-03-10 11:35:51 +01:00
parent 9930756d7c
commit 5886bdea31

View file

@ -220,8 +220,8 @@ uip_icmp6_error_output(uint8_t type, uint8_t code, uint32_t param) {
} }
#if UIP_CONF_IPV6_RPL #if UIP_CONF_IPV6_RPL
uip_ext_len = rpl_invert_header(); rpl_remove_header();
#else /* UIP_CONF_IPV6_RPL */ #else
uip_ext_len = 0; uip_ext_len = 0;
#endif /* UIP_CONF_IPV6_RPL */ #endif /* UIP_CONF_IPV6_RPL */
@ -280,6 +280,10 @@ uip_icmp6_error_output(uint8_t type, uint8_t code, uint32_t param) {
UIP_ICMP_BUF->icmpchksum = 0; UIP_ICMP_BUF->icmpchksum = 0;
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum(); UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
#if UIP_CONF_IPV6_RPL
rpl_insert_header();
#endif /* UIP_CONF_IPV6_RPL */
UIP_STAT(++uip_stat.icmp.sent); UIP_STAT(++uip_stat.icmp.sent);
PRINTF("Sending ICMPv6 ERROR message type %d code %d to ", type, code); PRINTF("Sending ICMPv6 ERROR message type %d code %d to ", type, code);