fixed a bug on handling of tree create sequence number
authorSaverio Proto <zioproto@gmail.com>
Fri, 4 Jun 2010 14:30:51 +0000 (16:30 +0200)
committerSaverio Proto <zioproto@gmail.com>
Fri, 4 Jun 2010 14:30:51 +0000 (16:30 +0200)
lib/obamp/src/obamp.c

index 2c343a9..a183aca 100644 (file)
@@ -919,7 +919,7 @@ manage_tree_create(char *packet)
     } else {
 
 
-      if ( ((msg->SequenceNumber > myState->TreeCreateSequenceNumber) && ((msg->SequenceNumber - myState->TreeCreateSequenceNumber ) <= 127)) || ((myState->TreeCreateSequenceNumber > msg->SequenceNumber) && ((myState->TreeCreateSequenceNumber - msg->SequenceNumber) > 127 ))    /*myState->TreeCreateSequenceNumber < msg->SequenceNumber*/) {    //If tree create is not a duplicate
+      if ( (((msg->SequenceNumber > myState->TreeCreateSequenceNumber) && ((msg->SequenceNumber - myState->TreeCreateSequenceNumber ) <= 127)) || ((myState->TreeCreateSequenceNumber > msg->SequenceNumber) && ((myState->TreeCreateSequenceNumber - msg->SequenceNumber) > 127 ))    /*myState->TreeCreateSequenceNumber < msg->SequenceNumber*/) || myState->TreeCreateSequenceNumber == 0 ) {    //If tree create is not a duplicate
         OLSR_DEBUG(LOG_PLUGINS, "myState->TreeCreateSequenceNumber < msg->SequenceNumber --- %d < %d",myState->TreeCreateSequenceNumber,msg->SequenceNumber);
        myState->TreeCreateSequenceNumber = msg->SequenceNumber;