diff --git a/core/net/ipv6/uip6.c b/core/net/ipv6/uip6.c index 746b31ab2..05d0457d9 100644 --- a/core/net/ipv6/uip6.c +++ b/core/net/ipv6/uip6.c @@ -1547,10 +1547,6 @@ uip_process(uint8_t flag) uip_appdata = &uip_buf[UIP_LLH_LEN + UIP_IPTCPH_LEN]; -#if UIP_CONF_IPV6_RPL - rpl_insert_header(); -#endif /* UIP_CONF_IPV6_RPL */ - #if UIP_UDP_CHECKSUMS /* Calculate UDP checksum. */ UIP_UDP_BUF->udpchksum = ~(uip_udpchksum()); @@ -1558,6 +1554,11 @@ uip_process(uint8_t flag) UIP_UDP_BUF->udpchksum = 0xffff; } #endif /* UIP_UDP_CHECKSUMS */ + +#if UIP_CONF_IPV6_RPL + rpl_insert_header(); +#endif /* UIP_CONF_IPV6_RPL */ + UIP_STAT(++uip_stat.udp.sent); goto ip_send_nolen; #endif /* UIP_UDP */ diff --git a/core/net/rpl/rpl-ext-header.c b/core/net/rpl/rpl-ext-header.c index fb430fa8d..4aa93d228 100644 --- a/core/net/rpl/rpl-ext-header.c +++ b/core/net/rpl/rpl-ext-header.c @@ -348,12 +348,8 @@ rpl_invert_header(void) void rpl_insert_header(void) { - uint8_t uip_ext_opt_offset; - if(default_instance != NULL) { - uip_ext_opt_offset = 2; - if(UIP_EXT_HDR_OPT_BUF->type == UIP_EXT_HDR_OPT_RPL) { - rpl_update_header_empty(); - } + if(default_instance != NULL && !uip_is_addr_mcast(&UIP_IP_BUF->destipaddr)) { + rpl_update_header_empty(); } } /*---------------------------------------------------------------------------*/