Fix DAO-ACK support for non-storing

This commit is contained in:
Simon Duquennoy 2016-06-03 21:19:08 +02:00 committed by Simon Duquennoy
parent 6cdec70798
commit 4208973017

View File

@ -1061,7 +1061,7 @@ handle_dao_retransmission(void *ptr)
return; return;
} }
if(instance->of->dao_ack_callback) { if(RPL_IS_STORING(instance) && instance->of->dao_ack_callback) {
/* Inform the objective function about the timeout. */ /* Inform the objective function about the timeout. */
instance->of->dao_ack_callback(parent, RPL_DAO_ACK_TIMEOUT); instance->of->dao_ack_callback(parent, RPL_DAO_ACK_TIMEOUT);
} }
@ -1274,11 +1274,15 @@ dao_ack_input(void)
return; return;
} }
parent = rpl_find_parent(instance->current_dag, &UIP_IP_BUF->srcipaddr); if(RPL_IS_STORING(instance)) {
if(parent == NULL) { parent = rpl_find_parent(instance->current_dag, &UIP_IP_BUF->srcipaddr);
/* not a known instance - drop the packet and ignore */ if(parent == NULL) {
uip_clear_buf(); /* not a known instance - drop the packet and ignore */
return; uip_clear_buf();
return;
}
} else {
parent = NULL;
} }
PRINTF("RPL: Received a DAO %s with sequence number %d (%d) and status %d from ", PRINTF("RPL: Received a DAO %s with sequence number %d (%d) and status %d from ",
@ -1294,7 +1298,7 @@ dao_ack_input(void)
ctimer_stop(&instance->dao_retransmit_timer); ctimer_stop(&instance->dao_retransmit_timer);
/* Inform objective function on status of the DAO ACK */ /* Inform objective function on status of the DAO ACK */
if(instance->of->dao_ack_callback) { if(RPL_IS_STORING(instance) && instance->of->dao_ack_callback) {
instance->of->dao_ack_callback(parent, status); instance->of->dao_ack_callback(parent, status);
} }
@ -1308,7 +1312,7 @@ dao_ack_input(void)
} }
#endif #endif
} else { } else if(RPL_IS_STORING(instance)) {
/* this DAO ACK should be forwarded to another recently registered route */ /* this DAO ACK should be forwarded to another recently registered route */
uip_ds6_route_t *re; uip_ds6_route_t *re;
uip_ipaddr_t *nexthop; uip_ipaddr_t *nexthop;