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,12 +1274,16 @@ dao_ack_input(void)
return; return;
} }
if(RPL_IS_STORING(instance)) {
parent = rpl_find_parent(instance->current_dag, &UIP_IP_BUF->srcipaddr); parent = rpl_find_parent(instance->current_dag, &UIP_IP_BUF->srcipaddr);
if(parent == NULL) { if(parent == NULL) {
/* not a known instance - drop the packet and ignore */ /* not a known instance - drop the packet and ignore */
uip_clear_buf(); uip_clear_buf();
return; 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 ",
status < 128 ? "ACK" : "NACK", status < 128 ? "ACK" : "NACK",
@ -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;