* Respect "destination only" flag in RREQs.

* If our routes seqno is <= requester last known seqno our route must
  be bad (in his eyes). Previos comparison was < which must be wrong.
This commit is contained in:
bg- 2007-05-09 14:53:54 +00:00
parent 34490eeecb
commit faf94db265

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: uaodv.c,v 1.17 2007/05/09 13:54:41 bg- Exp $
* $Id: uaodv.c,v 1.18 2007/05/09 14:53:54 bg- Exp $
*/
/**
@ -268,13 +268,14 @@ handle_incoming_rreq(void)
}
/* Check if it is for our address or a fresh route. */
if(uip_ipaddr_cmp(&rm->dest_addr, &uip_hostaddr)) {
if(uip_ipaddr_cmp(&rm->dest_addr, &uip_hostaddr)
|| rm->flags & UAODV_RREQ_DESTONLY) {
fw = NULL;
} else {
fw = uaodv_rt_lookup(&rm->dest_addr);
if(!(rm->flags & UAODV_RREQ_UNKSEQNO)
&& fw != NULL
&& SCMP32(ntohl(rm->dest_seqno), fw->hseqno) >= 0) {
&& SCMP32(fw->hseqno, ntohl(rm->dest_seqno)) <= 0) {
fw = NULL;
}
}