fixed a bug in nbr policy and DAO retransmission handling and added new wismote simulation

This commit is contained in:
Joakim Eriksson 2016-02-18 22:40:30 +01:00
parent ee97dc4bcd
commit 12ac02650b
3 changed files with 751 additions and 27 deletions

View file

@ -976,6 +976,25 @@ dao_output(rpl_parent_t *parent, uint8_t lifetime)
return;
}
#if RPL_WITH_DAO_ACK
/* set up the state since this will be the first transmission of DAO */
/* retransmissions will call directly to dao_output_target_seq */
/* keep track of my own sending of DAO for handling ack and loss of ack */
if(lifetime != RPL_ZERO_LIFETIME) {
rpl_instance_t *instance;
instance = parent->dag->instance;
instance->my_dao_seqno = dao_sequence;
instance->my_dao_transmissions = 1;
ctimer_set(&instance->dao_retransmit_timer, RPL_DAO_RETRANSMISSION_TIMEOUT,
handle_dao_retransmission, parent);
}
#else
/* We know that we have tried to register so now we are assuming
that we have a down-link - unless this is a zero lifetime one */
rpl_set_downward_link(lifetime != RPL_ZERO_LIFETIME);
#endif /* RPL_WITH_DAO_ACK */
/* Sending a DAO with own prefix as target */
dao_output_target(parent, &prefix, lifetime);
}
@ -1074,19 +1093,6 @@ dao_output_target_seq(rpl_parent_t *parent, uip_ipaddr_t *prefix,
if(rpl_get_parent_ipaddr(parent) != NULL) {
uip_icmp6_send(rpl_get_parent_ipaddr(parent), ICMP6_RPL, RPL_CODE_DAO, pos);
#if RPL_WITH_DAO_ACK
if(lifetime != RPL_ZERO_LIFETIME) {
/* keep track of my own sending of DAO for handling ack and loss of ack */
instance->my_dao_seqno = dao_sequence;
instance->my_dao_transmissions = 1;
ctimer_set(&instance->dao_retransmit_timer, RPL_DAO_RETRANSMISSION_TIMEOUT,
handle_dao_retransmission, parent);
}
#else /* RPL_WITH_DAO_ACK */
/* We know that we have tried to register so now we are assuming
that we have a down-link - unless this is a zero lifetime one */
rpl_set_downward_link(lifetime != RPL_ZERO_LIFETIME);
#endif /* RPL_WITH_DAO_ACK */
}
}
/*---------------------------------------------------------------------------*/