* When looking up potentially bad routes use uaodv_rt_lookup_any

rather than uaodv_rt_lookup.
This commit is contained in:
bg- 2007-05-09 16:45:03 +00:00
parent 4601d620b9
commit 82aa4b4926
2 changed files with 5 additions and 5 deletions

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: uaodv-rt.c,v 1.5 2007/05/09 13:45:41 bg- Exp $ * $Id: uaodv-rt.c,v 1.6 2007/05/09 16:45:53 bg- Exp $
*/ */
/** /**
@ -67,7 +67,7 @@ uaodv_rt_add(uip_ipaddr_t *dest, uip_ipaddr_t *nexthop,
struct uaodv_rt_entry *e; struct uaodv_rt_entry *e;
/* Avoid inserting duplicate entries. */ /* Avoid inserting duplicate entries. */
e = uaodv_rt_lookup(dest); e = uaodv_rt_lookup_any(dest);
if(e != NULL) { if(e != NULL) {
list_remove(route_table, e); list_remove(route_table, e);
} else { } else {

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: uaodv.c,v 1.18 2007/05/09 14:53:54 bg- Exp $ * $Id: uaodv.c,v 1.19 2007/05/09 16:45:03 bg- Exp $
*/ */
/** /**
@ -393,7 +393,7 @@ handle_incoming_rerr(void)
if(uip_ipaddr_cmp(&rm->unreach[0].addr, &uip_hostaddr)) if(uip_ipaddr_cmp(&rm->unreach[0].addr, &uip_hostaddr))
return; return;
rt = uaodv_rt_lookup(&rm->unreach[0].addr); rt = uaodv_rt_lookup_any(&rm->unreach[0].addr);
if(rt != NULL && uip_ipaddr_cmp(&rt->nexthop, uip_udp_sender())) { if(rt != NULL && uip_ipaddr_cmp(&rt->nexthop, uip_udp_sender())) {
if(rm->flags & UAODV_RERR_UNKNOWN || rm->unreach[0].seqno == 0 if(rm->flags & UAODV_RERR_UNKNOWN || rm->unreach[0].seqno == 0
|| SCMP32(rt->hseqno, ntohl(rm->unreach[0].seqno)) <= 0) { || SCMP32(rt->hseqno, ntohl(rm->unreach[0].seqno)) <= 0) {
@ -438,7 +438,7 @@ static u32_t bad_seqno; /* In network byte order! */
void void
uaodv_bad_dest(uip_ipaddr_t *dest) uaodv_bad_dest(uip_ipaddr_t *dest)
{ {
struct uaodv_rt_entry *rt = uaodv_rt_lookup(dest); struct uaodv_rt_entry *rt = uaodv_rt_lookup_any(dest);
if(rt == NULL) if(rt == NULL)
bad_seqno = 0; /* Or flag this in RERR? */ bad_seqno = 0; /* Or flag this in RERR? */