fixed so that DAO NACK now is either for the path or for RPL root - if from root then do not try to switch parent since that will not help
This commit is contained in:
parent
dae21fcb76
commit
8afe3fb9b7
@ -663,6 +663,7 @@ dao_input(void)
|
||||
int learned_from;
|
||||
rpl_parent_t *parent;
|
||||
uip_ds6_nbr_t *nbr;
|
||||
int is_root;
|
||||
|
||||
prefixlen = 0;
|
||||
parent = NULL;
|
||||
@ -695,6 +696,8 @@ dao_input(void)
|
||||
sequence = buffer[pos++];
|
||||
|
||||
dag = instance->current_dag;
|
||||
is_root = (dag->rank == ROOT_RANK(instance));
|
||||
|
||||
/* Is the DAG ID present? */
|
||||
if(flags & RPL_DAO_D_FLAG) {
|
||||
if(memcmp(&dag->dag_id, &buffer[pos], sizeof(dag->dag_id))) {
|
||||
@ -829,6 +832,7 @@ dao_input(void)
|
||||
if(flags & RPL_DAO_K_FLAG) {
|
||||
/* signal the failure to add the node */
|
||||
dao_ack_output(instance, &dao_sender_addr, sequence,
|
||||
is_root ? RPL_DAO_ACK_UNABLE_TO_ACCEPT_ROOT :
|
||||
RPL_DAO_ACK_UNABLE_TO_ACCEPT);
|
||||
}
|
||||
goto discard;
|
||||
@ -838,10 +842,10 @@ dao_input(void)
|
||||
if(rep == NULL) {
|
||||
RPL_STAT(rpl_stats.mem_overflows++);
|
||||
PRINTF("RPL: Could not add a route after receiving a DAO\n");
|
||||
|
||||
if(flags & RPL_DAO_K_FLAG) {
|
||||
/* signal the failure to add the node */
|
||||
dao_ack_output(instance, &dao_sender_addr, sequence,
|
||||
is_root ? RPL_DAO_ACK_UNABLE_TO_ACCEPT_ROOT :
|
||||
RPL_DAO_ACK_UNABLE_TO_ACCEPT);
|
||||
}
|
||||
goto discard;
|
||||
|
@ -122,8 +122,11 @@ reset(rpl_dag_t *dag)
|
||||
static void
|
||||
dao_ack_callback(rpl_parent_t *p, int status)
|
||||
{
|
||||
if(status == RPL_DAO_ACK_UNABLE_TO_ACCEPT_ROOT) {
|
||||
return;
|
||||
}
|
||||
/* here we need to handle failed DAO's and other stuff */
|
||||
PRINTF("RPL: MRHOF - DAO ACK received with status: %d", status);
|
||||
PRINTF("RPL: MRHOF - DAO ACK received with status: %d\n", status);
|
||||
if(status >= RPL_DAO_ACK_UNABLE_TO_ACCEPT) {
|
||||
/* punish the ETX as if this was 10 packets lost */
|
||||
neighbor_link_callback(p, MAC_TX_OK, 10);
|
||||
|
@ -94,6 +94,7 @@
|
||||
#define RPL_DAO_ACK_UNCONDITIONAL_ACCEPT 0
|
||||
#define RPL_DAO_ACK_ACCEPT 1 /* 1 - 127 is OK but not good */
|
||||
#define RPL_DAO_ACK_UNABLE_TO_ACCEPT 128 /* >127 is fail */
|
||||
#define RPL_DAO_ACK_UNABLE_TO_ACCEPT_ROOT 255 /* root can not accept */
|
||||
|
||||
#define RPL_DAO_ACK_TIMEOUT -1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user