From 33216b77e5e349e5b80a27bfd4e01c05ad4d3931 Mon Sep 17 00:00:00 2001 From: Niclas Date: Mon, 7 Feb 2011 22:56:06 +0100 Subject: [PATCH 1/3] fixed MOP bug and improved debug print messages --- core/net/rpl/rpl-icmp6.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/net/rpl/rpl-icmp6.c b/core/net/rpl/rpl-icmp6.c index 9beacdf40..a1e64cf87 100644 --- a/core/net/rpl/rpl-icmp6.c +++ b/core/net/rpl/rpl-icmp6.c @@ -61,7 +61,7 @@ /*---------------------------------------------------------------------------*/ #define RPL_DIO_GROUNDED 0x80 #define RPL_DIO_MOP_SHIFT 3 -#define RPL_DIO_MOP_MASK 0x3c +#define RPL_DIO_MOP_MASK 0x07 #define RPL_DIO_PREFERENCE_MASK 0x07 #define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) @@ -211,7 +211,7 @@ dio_input(void) PRINTF("RPL: Incoming DIO rank %u\n", (unsigned)dio.rank); dio.grounded = buffer[i] & RPL_DIO_GROUNDED; - dio.mop = (buffer[i]& RPL_DIO_MOP_MASK) >> RPL_DIO_MOP_SHIFT; + dio.mop = (buffer[i] >> RPL_DIO_MOP_SHIFT) & RPL_DIO_MOP_MASK; dio.preference = buffer[i++] & RPL_DIO_PREFERENCE_MASK; dio.dtsn = buffer[i++]; @@ -232,7 +232,8 @@ dio_input(void) } if(len + i > buffer_length) { - PRINTF("RPL: Invalid DIO packet\n"); + PRINTF("RPL: Invalid DIO packet - packet too long: %d vs %d (%d,%d)\n", + len + i, buffer_length, subopt_type, len); RPL_STAT(rpl_stats.malformed_msgs++); return; } @@ -516,7 +517,7 @@ dao_input(void) rep = rpl_add_route(dag, &prefix, prefixlen, &dao_sender_addr); if(rep == NULL) { - RPL_STAT(rpl_stats.memory_overflows++); + RPL_STAT(rpl_stats.mem_overflows++); PRINTF("RPL: Could not add a route after receiving a DAO\n"); return; } else { From 5ca9608478a2549ea4b28729dc7b0175aa981a3d Mon Sep 17 00:00:00 2001 From: dak664 Date: Mon, 7 Feb 2011 17:39:49 -0500 Subject: [PATCH 2/3] Commit with CRLF line endings for github line ending conversion test. --- examples/webserver-ipv6-raven/Makefile.webserver | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/webserver-ipv6-raven/Makefile.webserver b/examples/webserver-ipv6-raven/Makefile.webserver index 3faa39b7a..62b0d72e3 100644 --- a/examples/webserver-ipv6-raven/Makefile.webserver +++ b/examples/webserver-ipv6-raven/Makefile.webserver @@ -1,3 +1,4 @@ +#Commit with CRLF endings, for github line ending conversion test all: webserver6 From 4970c7c540514cc891ef6876c8b0a1e81f270182 Mon Sep 17 00:00:00 2001 From: dak664 Date: Mon, 7 Feb 2011 17:43:56 -0500 Subject: [PATCH 3/3] A second line ending commit which hopefully won't get pushed. --- examples/webserver-ipv6-raven/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/webserver-ipv6-raven/Makefile b/examples/webserver-ipv6-raven/Makefile index 7d1f72e3e..34615ec41 100644 --- a/examples/webserver-ipv6-raven/Makefile +++ b/examples/webserver-ipv6-raven/Makefile @@ -1,3 +1,4 @@ +#Commit with LF endings. Don't want to push this change, it's a test ifndef WEBDIR OUTFILE=webserver6 else