From: Joakim E. <jo...@us...> - 2012-01-13 13:40:30
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via 6ee05f4a2d6bee3384878b524590fc7630cdd283 (commit) from 8ee68b43455b9ef0a90ac9d5cf3dfa123f480a26 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6ee05f4a2d6bee3384878b524590fc7630cdd283 Author: Joakim Eriksson <jo...@si...> Date: Fri Jan 13 05:37:30 2012 -0800 fixed loop detection bug in RPL diff --git a/core/net/rpl/rpl-ext-header.c b/core/net/rpl/rpl-ext-header.c index cf83139..f94a00c 100644 --- a/core/net/rpl/rpl-ext-header.c +++ b/core/net/rpl/rpl-ext-header.c @@ -66,8 +66,8 @@ int rpl_verify_header(int uip_ext_opt_offset) { rpl_instance_t *instance; - long diff; int down; + uint8_t sender_closer; if(UIP_EXT_HDR_OPT_RPL_BUF->opt_len != RPL_HDR_OPT_LEN) { PRINTF("RPL: Bad header option! (wrong length)\n"); @@ -99,9 +99,11 @@ rpl_verify_header(int uip_ext_opt_offset) PRINTF("RPL: Packet going %s\n", down == 1 ? "down" : "up"); - diff = UIP_EXT_HDR_OPT_RPL_BUF->senderrank - instance->current_dag->rank; - if((down && diff > 0) || (!down && diff < 0)) { - PRINTF("RPL: Loop detected\n"); + sender_closer = UIP_EXT_HDR_OPT_RPL_BUF->senderrank < instance->current_dag->rank; + if((down && !sender_closer) || (!down && sender_closer)) { + PRINTF("RPL: Loop detected - senderrank: %d my-rank: %d sender_closer: %d\n", + UIP_EXT_HDR_OPT_RPL_BUF->senderrank, instance->current_dag->rank, + sender_closer); if(UIP_EXT_HDR_OPT_RPL_BUF->flags & RPL_HDR_OPT_RANK_ERR) { PRINTF("RPL: Rank error signalled in RPL option!\n"); /* We should try to repair it, not implemented for the moment */ ----------------------------------------------------------------------- Summary of changes: core/net/rpl/rpl-ext-header.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) hooks/post-receive -- contiki |