OBAMP: reset tree links if I lose the tree link with my tree parent
authorSaverio Proto <zioproto@gmail.com>
Thu, 10 Jun 2010 14:10:30 +0000 (16:10 +0200)
committerSaverio Proto <zioproto@gmail.com>
Thu, 10 Jun 2010 14:10:30 +0000 (16:10 +0200)
lib/obamp/src/obamp.c

index 7d93da0..e9b23e5 100644 (file)
@@ -1421,6 +1421,11 @@ mesh_create(void *x)
         if (tmp->isMesh == 0 && tmp->isTree == 1) {
 
           tmp->isTree = 0;
+       
+        if (memcmp(&tmp->neighbor_ip_addr.v4, &myState->ParentId.v4, sizeof(struct in_addr)) == 0) {
+               OLSR_DEBUG(LOG_PLUGINS,"RESET TREE LINKS: I lost tree link with my PARENT");
+               reset_tree_links();
+       }       
 
         }
       }