1 diff -Nur olsrd-0.4.10.orig/src/duplicate_set.c olsrd-0.4.10/src/duplicate_set.c
2 --- olsrd-0.4.10.orig/src/duplicate_set.c 2005-02-27 19:39:43.000000000 +0100
3 +++ olsrd-0.4.10/src/duplicate_set.c 2006-02-22 12:24:03.000000000 +0100
7 /* Hash the senders address */
8 - hash = olsr_hashing(originator);
9 + hash = HASHMASK & seqno;
11 new_dup_entry = olsr_malloc(sizeof(struct dup_entry), "New dup entry");
14 struct dup_entry *tmp_dup_table;
16 /* Hash the senders address */
17 - hash = olsr_hashing(originator);
18 + hash = HASHMASK & seqno;
21 for(tmp_dup_table = dup_set[hash].next;
23 struct dup_entry *tmp_dup_table;
25 /* Hash the senders address */
26 - hash = olsr_hashing(originator);
27 + hash = HASHMASK & seqno;
30 for(tmp_dup_table = dup_set[hash].next;
32 struct dup_iface *new_iface;
34 /* Hash the senders address */
35 - hash = olsr_hashing(originator);
36 + hash = HASHMASK & seqno;
41 struct dup_entry *tmp_dup_table;
43 /* Hash the senders address */
44 - hash = olsr_hashing(originator);
45 + hash = HASHMASK & seqno;
48 for(tmp_dup_table = dup_set[hash].next;
49 diff -Nur olsrd-0.4.10.orig/src/hashing.c olsrd-0.4.10/src/hashing.c
50 --- olsrd-0.4.10.orig/src/hashing.c 2005-02-20 19:52:18.000000000 +0100
51 +++ olsrd-0.4.10/src/hashing.c 2006-02-22 12:23:24.000000000 +0100
54 if(olsr_cnf->ip_version == AF_INET)
56 - hash = (ntohl(address->v4));
57 + hash = address->v4x[0] ^ address->v4x[1] ^ address->v4x[2] ^ address->v4x[3];
61 diff -Nur olsrd-0.4.10.orig/src/hashing.h olsrd-0.4.10/src/hashing.h
62 --- olsrd-0.4.10.orig/src/hashing.h 2005-02-20 19:52:18.000000000 +0100
63 +++ olsrd-0.4.10/src/hashing.h 2006-02-22 12:23:14.000000000 +0100
70 #define HASHMASK (HASHSIZE - 1)
72 #include "olsr_types.h"
73 diff -Nur olsrd-0.4.10.orig/src/lq_avl.c olsrd-0.4.10/src/lq_avl.c
74 --- olsrd-0.4.10.orig/src/lq_avl.c 2005-01-22 15:30:57.000000000 +0100
75 +++ olsrd-0.4.10/src/lq_avl.c 2006-02-22 12:22:12.000000000 +0100
88 +static struct avl_node *avl_find_rec_ipv4(struct avl_node *node, void *key)
90 + if (*(unsigned int *)key < *(unsigned int *)node->key) {
91 + if (node->left != NULL) {
92 + return avl_find_rec_ipv4(node->left, key);
95 + else if (*(unsigned int *)key > *(unsigned int *)node->key) {
96 + if (node->right != NULL) {
97 + return avl_find_rec_ipv4(node->right, key);
103 static struct avl_node *avl_find_rec(struct avl_node *node, void *key,
104 int (*comp)(void *, void *))
109 + return avl_find_rec_ipv4(node, key);
111 diff = (*comp)(key, node->key);
116 node = avl_find_rec(tree->root, key, tree->comp);
118 + if (0 == tree->comp) {
119 + if (0 != svenola_avl_comp_ipv4(node->key, key))
123 if ((*tree->comp)(node->key, key) != 0)
128 node = avl_find_rec(tree->root, new->key, tree->comp);
130 + if (0 == tree->comp) {
131 + diff = svenola_avl_comp_ipv4(new->key, node->key);
134 diff = (*tree->comp)(new->key, node->key);
137 diff -Nur olsrd-0.4.10.orig/src/lq_avl.h olsrd-0.4.10/src/lq_avl.h
138 --- olsrd-0.4.10.orig/src/lq_avl.h 2005-02-20 19:52:18.000000000 +0100
139 +++ olsrd-0.4.10/src/lq_avl.h 2006-02-22 12:22:12.000000000 +0100
141 struct avl_node *avl_find(struct avl_tree *, void *);
142 int avl_insert(struct avl_tree *, struct avl_node *);
144 +#define svenola_avl_comp_ipv4(ip1, ip2) \
145 + (*(unsigned int *)ip1 == *(unsigned int *)ip2 ? 0 : \
146 + *(unsigned int *)ip1 < *(unsigned int *)ip2 ? -1 : +1)
148 diff -Nur olsrd-0.4.10.orig/src/lq_list.c olsrd-0.4.10/src/lq_list.c
149 --- olsrd-0.4.10.orig/src/lq_list.c 2004-12-04 18:06:57.000000000 +0100
150 +++ olsrd-0.4.10/src/lq_list.c 2006-02-22 12:22:12.000000000 +0100
156 struct list_node *list_get_head(struct list *list)
165 void list_add_head(struct list *list, struct list_node *node)
167 diff -Nur olsrd-0.4.10.orig/src/lq_list.h olsrd-0.4.10/src/lq_list.h
168 --- olsrd-0.4.10.orig/src/lq_list.h 2005-02-20 19:52:18.000000000 +0100
169 +++ olsrd-0.4.10/src/lq_list.h 2006-02-22 12:22:12.000000000 +0100
172 void list_init(struct list *list);
175 +#define list_get_head(node) (node)->head
176 +#define list_get_tail(node) (node)->tail
177 +#define list_get_next(node) (node)->next
178 +#define list_get_prev(node) (node)->prev
180 struct list_node *list_get_head(struct list *list);
181 struct list_node *list_get_tail(struct list *list);
183 struct list_node *list_get_next(struct list_node *node);
184 struct list_node *list_get_prev(struct list_node *node);
187 void list_add_head(struct list *list, struct list_node *node);
188 void list_add_tail(struct list *list, struct list_node *node);
189 diff -Nur olsrd-0.4.10.orig/src/lq_route.c olsrd-0.4.10/src/lq_route.c
190 --- olsrd-0.4.10.orig/src/lq_route.c 2005-11-29 19:37:58.000000000 +0100
191 +++ olsrd-0.4.10/src/lq_route.c 2006-02-22 12:22:12.000000000 +0100
194 // add the vertex to the list, if it's not us
197 + if (svenola_avl_comp_ipv4(&main_addr, node->key) != 0)
199 + vert->node.data = vert;
200 + list_add_tail(vertex_list, &vert->node);
204 if ((*comp)(&main_addr, node->key) != 0)
206 vert->node.data = vert;
208 struct interface *inter;
214 avl_comp = avl_comp_ipv4;
218 avl_comp = avl_comp_ipv6;
219 diff -Nur olsrd-0.4.10.orig/src/olsr_types.h olsrd-0.4.10/src/olsr_types.h
220 --- olsrd-0.4.10.orig/src/olsr_types.h 2005-05-15 14:57:24.000000000 +0200
221 +++ olsrd-0.4.10/src/olsr_types.h 2006-02-22 12:22:43.000000000 +0100