From 5886bdea31b065b410e92aa68e113cfde4587f61 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Thu, 10 Mar 2016 11:35:51 +0100 Subject: [PATCH] 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 --- core/net/ipv6/uip-icmp6.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/net/ipv6/uip-icmp6.c b/core/net/ipv6/uip-icmp6.c index 157ed0edb..80d7a5582 100644 --- a/core/net/ipv6/uip-icmp6.c +++ b/core/net/ipv6/uip-icmp6.c @@ -220,8 +220,8 @@ uip_icmp6_error_output(uint8_t type, uint8_t code, uint32_t param) { } #if UIP_CONF_IPV6_RPL - uip_ext_len = rpl_invert_header(); -#else /* UIP_CONF_IPV6_RPL */ + rpl_remove_header(); +#else uip_ext_len = 0; #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 = ~uip_icmp6chksum(); +#if UIP_CONF_IPV6_RPL + rpl_insert_header(); +#endif /* UIP_CONF_IPV6_RPL */ + UIP_STAT(++uip_stat.icmp.sent); PRINTF("Sending ICMPv6 ERROR message type %d code %d to ", type, code);