1 diff -Nur olsrd-0.4.10.orig/src/defs.h olsrd-0.4.10/src/defs.h
2 --- olsrd-0.4.10.orig/src/defs.h 2006-01-01 16:59:02.000000000 +0100
3 +++ olsrd-0.4.10/src/defs.h 2006-10-31 19:34:52.000000000 +0100
5 #define OLSRD_GLOBAL_CONF_FILE "/etc/" OLSRD_CONF_FILE_NAME
8 -#define HOPCNT_MAX 32 /* maximum hops number */
9 +#define HOPCNT_MAX 64 /* maximum hops number */
10 #define MAXMESSAGESIZE 1500 /* max broadcast size */
11 #define UDP_IPV4_HDRSIZE 28
12 -#define UDP_IPV6_HDRSIZE 48
13 +#define UDP_IPV6_HDRSIZE 62
16 /* Debug helper macro */
17 diff -Nur olsrd-0.4.10.orig/src/interfaces.h olsrd-0.4.10/src/interfaces.h
18 --- olsrd-0.4.10.orig/src/interfaces.h 2005-06-03 10:00:55.000000000 +0200
19 +++ olsrd-0.4.10/src/interfaces.h 2006-10-31 19:44:52.000000000 +0100
21 struct vtimes valtimes;
23 struct if_gen_property *gen_properties;/* Generic interface properties */
25 + int ttl_index; /* index in TTL array for fish-eye */
27 struct interface *int_next;
29 diff -Nur olsrd-0.4.10.orig/src/link_set.c olsrd-0.4.10/src/link_set.c
30 --- olsrd-0.4.10.orig/src/link_set.c 2005-11-17 05:25:44.000000000 +0100
31 +++ olsrd-0.4.10/src/link_set.c 2006-10-31 19:31:19.000000000 +0100
34 entry->loss_link_quality =
35 (float)(entry->total_packets - entry->lost_packets) /
36 - (float)(entry->loss_window_size);
38 + (float)(entry->loss_window_size < (2 * 4) ? entry->loss_window_size:
39 + 4 * ((entry->loss_window_size / 4 - 1) * entry->total_packets + entry->loss_window_size) / entry->loss_window_size);
41 // multiply the calculated link quality with the user-specified multiplier
43 entry->loss_link_quality *= entry->loss_link_multiplier;
44 diff -Nur olsrd-0.4.10.orig/src/lq_packet.c olsrd-0.4.10/src/lq_packet.c
45 --- olsrd-0.4.10.orig/src/lq_packet.c 2005-11-17 02:58:51.000000000 +0100
46 +++ olsrd-0.4.10/src/lq_packet.c 2006-10-31 21:51:11.000000000 +0100
49 struct neighbor_entry *walker;
50 struct link_entry *link;
51 - static int ttl_list[] = { MAX_TTL, 3, 2, 1, 2, 1, 1, 3, 2, 1, 2, 1, 1, 0 };
52 - static int ttl_index = 0;
54 + static int ttl_list[] = { 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, MAX_TTL-1, 0};
56 // remember that we have generated an LQ TC message; this is
57 // checked in net_output()
61 if (olsr_cnf->lq_fish > 0)
63 - if (ttl_list[ttl_index] == 0)
65 + // SVEN_OLA: Too lazy to find the different iface inits. This will do it too.
66 + if (outif->ttl_index >= sizeof(ttl_list) / sizeof(ttl_list[0])) outif->ttl_index = 0;
68 + if (ttl_list[outif->ttl_index] == 0)
69 + outif->ttl_index = 0;
71 - lq_tc->comm.ttl = ttl_list[ttl_index++];
72 + lq_tc->comm.ttl = ttl_list[outif->ttl_index++];
74 OLSR_PRINTF(3, "Creating LQ TC with TTL %d.\n", lq_tc->comm.ttl);
76 diff -Nur olsrd-0.4.10.orig/src/olsr.c olsrd-0.4.10/src/olsr.c
77 --- olsrd-0.4.10.orig/src/olsr.c 2005-11-17 05:25:44.000000000 +0100
78 +++ olsrd-0.4.10/src/olsr.c 2006-10-31 19:31:19.000000000 +0100
80 olsr_bool changes_topology;
81 olsr_bool changes_neighborhood;
82 olsr_bool changes_hna;
83 +olsr_bool changes_force;
86 * Process changes functions
88 OLSR_PRINTF(3, "CHANGES IN HNA\n")
91 + if(!changes_force &&
92 + 2 <= olsr_cnf->lq_level &&
93 + 0 >= olsr_cnf->lq_dlimit)
96 if(!changes_neighborhood &&
100 olsr_calculate_routing_table();
101 olsr_calculate_hna_routes();
106 - olsr_calculate_lq_routing_table();
110 else if (changes_topology)
112 olsr_calculate_routing_table();
113 olsr_calculate_hna_routes();
118 - olsr_calculate_lq_routing_table();
122 else if (changes_hna)
123 @@ -202,11 +198,11 @@
125 olsr_calculate_hna_routes();
130 - olsr_calculate_lq_routing_table();
134 + if (olsr_cnf->lq_level >= 2)
136 + olsr_calculate_lq_routing_table();
139 if (olsr_cnf->debug_level > 0)
141 changes_neighborhood = OLSR_FALSE;
142 changes_topology = OLSR_FALSE;
143 changes_hna = OLSR_FALSE;
144 + changes_force = OLSR_FALSE;
148 diff -Nur olsrd-0.4.10.orig/src/olsr.h olsrd-0.4.10/src/olsr.h
149 --- olsrd-0.4.10.orig/src/olsr.h 2005-05-29 14:47:45.000000000 +0200
150 +++ olsrd-0.4.10/src/olsr.h 2006-10-31 19:31:19.000000000 +0100
152 extern olsr_bool changes_topology;
153 extern olsr_bool changes_neighborhood;
154 extern olsr_bool changes_hna;
155 +extern olsr_bool changes_force;
158 register_pcf(int (*)(int, int, int));
159 diff -Nur olsrd-0.4.10.orig/src/scheduler.c olsrd-0.4.10/src/scheduler.c
160 --- olsrd-0.4.10.orig/src/scheduler.c 2005-12-29 23:34:37.000000000 +0100
161 +++ olsrd-0.4.10/src/scheduler.c 2006-10-31 19:31:19.000000000 +0100
164 changes_neighborhood = OLSR_TRUE;
165 changes_topology = OLSR_TRUE;
166 + changes_force = OLSR_TRUE;
170 diff -Nur olsrd-0.4.10.orig/src/unix/ifnet.c olsrd-0.4.10/src/unix/ifnet.c
171 --- olsrd-0.4.10.orig/src/unix/ifnet.c 2005-12-29 19:37:16.000000000 +0100
172 +++ olsrd-0.4.10/src/unix/ifnet.c 2006-10-31 21:44:59.000000000 +0100
177 +static char basename[32];
178 +char* if_basename(char* name);
179 +char* if_basename(char* name)
181 + char *p = strchr(name, ':');
182 + if (0 == p || p - name >= (int)(sizeof(basename) / sizeof(basename[0]) - 1)) return name;
183 + memcpy(basename, name, p - name);
184 + basename[p - name] = 0;
189 * Initializes a interface described by iface,
190 * if it is set up and is of the correct type.
191 @@ -832,10 +843,10 @@
194 /* Deactivate IP spoof filter */
195 - deactivate_spoof(ifr.ifr_name, iface->index, olsr_cnf->ip_version);
196 + deactivate_spoof(if_basename(ifr.ifr_name), iface->index, olsr_cnf->ip_version);
198 /* Disable ICMP redirects */
199 - disable_redirects(ifr.ifr_name, iface->index, olsr_cnf->ip_version);
200 + disable_redirects(if_basename(ifr.ifr_name), iface->index, olsr_cnf->ip_version);
205 ifp->gen_properties = NULL;
206 ifp->int_name = olsr_malloc(strlen(ifr.ifr_name) + 1, "Interface update 3");
208 - strcpy(ifp->int_name, ifr.ifr_name);
209 + strcpy(ifp->int_name, if_basename(ifr.ifr_name));
210 /* Segfaults if using strncpy(IFNAMSIZ) why oh why?? */
211 ifp->int_next = ifnet;