[Olsr-cvs] olsrd-current/src lq_route.c, 1.38, 1.39 routing_table.c, 1.22, 1.23 routing_table.h, 1.16, 1.17
Thomas Lopatic
(spam-protected)
Thu Nov 17 00:55:56 CET 2005
Update of /cvsroot/olsrd/olsrd-current/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3945/src
Modified Files:
lq_route.c routing_table.c routing_table.h
Log Message:
For HNA routes search the correct routing table, i.e. the HNA routing
table, for duplicates.
Index: lq_route.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/lq_route.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** lq_route.c 15 Nov 2005 23:46:20 -0000 1.38
--- lq_route.c 16 Nov 2005 23:55:54 -0000 1.39
***************
*** 651,655 ****
// we already have a route via a previous (better) node
! if (olsr_lookup_routing_table(&hna->A_network_addr) != NULL)
continue;
--- 651,655 ----
// we already have a route via a previous (better) node
! if (olsr_lookup_hna_routing_table(&hna->A_network_addr) != NULL)
continue;
Index: routing_table.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/routing_table.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** routing_table.c 29 May 2005 12:47:45 -0000 1.22
--- routing_table.c 16 Nov 2005 23:55:54 -0000 1.23
***************
*** 134,139 ****
--- 134,159 ----
}
+ /**
+ * Look up an entry in the HNA routing table.
+ *
+ * @param dst the address of the entry
+ *
+ * @return a pointer to a rt_entry struct
+ * representing the route entry.
+ */
+
+ struct rt_entry *
+ olsr_lookup_hna_routing_table(union olsr_ip_addr *dst)
+ {
+ struct rt_entry *walker;
+ olsr_u32_t hash = olsr_hashing(dst);
+ for (walker = hna_routes[hash].next; walker != &hna_routes[hash];
+ walker = walker->next)
+ if (COMP_IP(&walker->rt_dst, dst))
+ return walker;
+ return NULL;
+ }
/**
Index: routing_table.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/routing_table.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** routing_table.h 29 May 2005 12:47:45 -0000 1.16
--- routing_table.h 16 Nov 2005 23:55:54 -0000 1.17
***************
*** 113,116 ****
--- 113,119 ----
olsr_lookup_routing_table(union olsr_ip_addr *);
+ struct rt_entry *
+ olsr_lookup_hna_routing_table(union olsr_ip_addr *dst);
+
void
olsr_free_routing_table(struct rt_entry *);
More information about the Olsr-cvs
mailing list