From 8b8f23962e16c87f1296dad31b6c6edcc814a7bf Mon Sep 17 00:00:00 2001 From: bg- Date: Tue, 5 Jun 2007 10:04:20 +0000 Subject: [PATCH] * Send RREP-ACKs if we can. --- core/net/uaodv.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/core/net/uaodv.c b/core/net/uaodv.c index c51dcd0c0..a28c5107b 100644 --- a/core/net/uaodv.c +++ b/core/net/uaodv.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: uaodv.c,v 1.27 2007/06/01 14:49:54 bg- Exp $ + * $Id: uaodv.c,v 1.28 2007/06/05 10:04:20 bg- Exp $ */ /** @@ -395,15 +395,15 @@ handle_incoming_rrep(void) print_debug("Not inserting\n"); } - if(rm->flags & UAODV_RREP_ACK) { - print_debug("RREP with ACK request (ignored)!\n"); - /* Don't want any RREP-ACKs in return! */ - rm->flags &= ~UAODV_RREP_ACK; - } - /* Forward RREP towards originator? */ if(uip_ipaddr_cmp(&rm->orig_addr, &uip_hostaddr)) { - print_debug("------- COMPLETE ROUTE FOUND\n"); + print_debug("ROUTE FOUND\n"); + if(rm->flags & UAODV_RREP_ACK) { + struct uaodv_msg_rrep_ack *ack = (void *)uip_appdata; + ack->type = UAODV_RREP_ACK_TYPE; + ack->reserved = 0; + sendto(uip_udp_sender(), ack, sizeof(*ack)); + } } else { rt = uaodv_rt_lookup(&rm->orig_addr); @@ -412,6 +412,12 @@ handle_incoming_rrep(void) return; } + if(rm->flags & UAODV_RREP_ACK) { + print_debug("RREP with ACK request (ignored)!\n"); + /* Don't want any RREP-ACKs in return! */ + rm->flags &= ~UAODV_RREP_ACK; + } + rm->hop_count++; print_debug("Fwd RREP to %d.%d.%d.%d\n", uip_ipaddr_to_quad(&rt->nexthop));