From 465f9096b112633e15a057e3cee7fb920602bbeb Mon Sep 17 00:00:00 2001 From: Lotte Steenbrink Date: Tue, 6 Jan 2015 05:45:23 -0800 Subject: [PATCH] aodvv2: call aodv_packet_reader_handle_packet() when recieved packet is *not* our own. For some reason the call to aodv_packet_reader_handle_packet() got lumped in with the check if a received packet is ours. In consequence, all packets which were not sent by the node that received them (i.e. the important ones) were silently ignored, preventing any routes from being established. This should be fixed now: foreign packets are now handled again, while own packets are ignored. Also, I made the corresponding comment a bit less passive-aggressive. --- sys/net/routing/aodvv2/aodv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/net/routing/aodvv2/aodv.c b/sys/net/routing/aodvv2/aodv.c index 637cd8091b..3bace8765d 100644 --- a/sys/net/routing/aodvv2/aodv.c +++ b/sys/net/routing/aodvv2/aodv.c @@ -294,9 +294,11 @@ static void *_aodv_receiver_thread(void *arg) struct netaddr _sender; ipv6_addr_t_to_netaddr(&sa_rcv.sin6_addr, &_sender); - /* For some reason we sometimes get passed our own packets. drop them. */ + /* We sometimes get passed our own packets. Drop them. */ if (netaddr_cmp(&_sender, &na_local) == 0) { AODV_DEBUG("received our own packet, dropping it.\n"); + } + else { aodv_packet_reader_handle_packet((void *) buf_rcv, rcv_size, &_sender); } } @@ -354,9 +356,9 @@ ipv6_addr_t *aodv_get_next_hop(ipv6_addr_t *dest) DEBUG("[aodvv2][ndp] found NC entry. Returning dest addr.\n"); return dest; } + DEBUG("\t[ndp] no entry for addr %s found\n", ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, dest)); - if (rt_entry) { /* Case 1: Undeliverable Packet */ int packet_indeliverable = rt_entry->state == ROUTE_STATE_BROKEN ||