Inserts missing IPv6 Hop-By-Hop RPL Option at first hop

This commit is contained in:
Sébastien Dawans 2013-07-31 22:39:00 +02:00
parent a07d332339
commit 78e807403c
3 changed files with 17 additions and 0 deletions

View File

@ -343,4 +343,16 @@ 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();
}
}
}
/*---------------------------------------------------------------------------*/
#endif /* UIP_CONF_IPV6 */

View File

@ -240,6 +240,7 @@ rpl_instance_t *rpl_get_instance(uint8_t instance_id);
void rpl_update_header_empty(void);
int rpl_update_header_final(uip_ipaddr_t *addr);
int rpl_verify_header(int);
void rpl_insert_header(void);
void rpl_remove_header(void);
uint8_t rpl_invert_header(void);
uip_ipaddr_t *rpl_get_parent_ipaddr(rpl_parent_t *nbr);

View File

@ -1557,6 +1557,10 @@ 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());