prevent the rpl root from dropping packets bound for outside the dodag while in NS mode

This commit is contained in:
andrewbrannan 2017-03-08 12:42:56 +00:00
parent 8248f524f5
commit 0a85ccdc56

View file

@ -644,11 +644,17 @@ rpl_update_header(void)
/* At the root, remove headers if any, and insert SRH or HBH /* At the root, remove headers if any, and insert SRH or HBH
* (SRH is inserted only if the destination is in the DODAG) */ * (SRH is inserted only if the destination is in the DODAG) */
rpl_remove_header(); rpl_remove_header();
if(rpl_get_dag(&UIP_IP_BUF->destipaddr) != NULL) {
/* dest is in a DODAG; the packet is going down. */
if(RPL_IS_NON_STORING(default_instance)) { if(RPL_IS_NON_STORING(default_instance)) {
return insert_srh_header(); return insert_srh_header();
} else { } else {
return insert_hbh_header(default_instance); return insert_hbh_header(default_instance);
} }
} else {
/* dest is outside of DODAGs; no ext header is needed. */
return 1;
}
} else { } else {
if(uip_ds6_is_my_addr(&UIP_IP_BUF->srcipaddr) if(uip_ds6_is_my_addr(&UIP_IP_BUF->srcipaddr)
&& UIP_IP_BUF->ttl == uip_ds6_if.cur_hop_limit) { && UIP_IP_BUF->ttl == uip_ds6_if.cur_hop_limit) {