port pmacct to -ng
[openwrt/svn-archive/archive.git] / net / olsrd / patches / 130-olsrd_fixes.patch
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-03-02 02:10:02.000000000 +0100
4 @@ -71,7 +71,7 @@
5 #define HOPCNT_MAX 32 /* maximum hops number */
6 #define MAXMESSAGESIZE 1500 /* max broadcast size */
7 #define UDP_IPV4_HDRSIZE 28
8 -#define UDP_IPV6_HDRSIZE 48
9 +#define UDP_IPV6_HDRSIZE 62
10 #define MAX_IFS 16
11
12 /* Debug helper macro */
13 diff -Nur olsrd-0.4.10.orig/src/link_set.c olsrd-0.4.10/src/link_set.c
14 --- olsrd-0.4.10.orig/src/link_set.c 2005-11-17 05:25:44.000000000 +0100
15 +++ olsrd-0.4.10/src/link_set.c 2006-03-02 02:10:02.000000000 +0100
16 @@ -952,8 +952,9 @@
17
18 entry->loss_link_quality =
19 (float)(entry->total_packets - entry->lost_packets) /
20 - (float)(entry->loss_window_size);
21 -
22 + (float)(entry->loss_window_size < (2 * 4) ? entry->loss_window_size:
23 + 4 * ((entry->loss_window_size / 4 - 1) * entry->total_packets + entry->loss_window_size) / entry->loss_window_size);
24 +
25 // multiply the calculated link quality with the user-specified multiplier
26
27 entry->loss_link_quality *= entry->loss_link_multiplier;
28 diff -Nur olsrd-0.4.10.orig/src/lq_packet.c olsrd-0.4.10/src/lq_packet.c
29 --- olsrd-0.4.10.orig/src/lq_packet.c 2005-11-17 02:58:51.000000000 +0100
30 +++ olsrd-0.4.10/src/lq_packet.c 2006-03-02 02:10:02.000000000 +0100
31 @@ -149,7 +149,8 @@
32 int i;
33 struct neighbor_entry *walker;
34 struct link_entry *link;
35 - static int ttl_list[] = { MAX_TTL, 3, 2, 1, 2, 1, 1, 3, 2, 1, 2, 1, 1, 0 };
36 + static int ttl_list[] = { 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, MAX_TTL-1, 0};
37 +
38 static int ttl_index = 0;
39
40 // remember that we have generated an LQ TC message; this is
41 diff -Nur olsrd-0.4.10.orig/src/olsr.c olsrd-0.4.10/src/olsr.c
42 --- olsrd-0.4.10.orig/src/olsr.c 2005-11-17 05:25:44.000000000 +0100
43 +++ olsrd-0.4.10/src/olsr.c 2006-03-02 02:16:42.000000000 +0100
44 @@ -68,6 +68,7 @@
45 olsr_bool changes_topology;
46 olsr_bool changes_neighborhood;
47 olsr_bool changes_hna;
48 +olsr_bool changes_force;
49
50 /**
51 * Process changes functions
52 @@ -142,6 +143,11 @@
53 OLSR_PRINTF(3, "CHANGES IN HNA\n")
54 #endif
55
56 + if(!changes_force &&
57 + 2 <= olsr_cnf->lq_level &&
58 + 0 >= olsr_cnf->lq_dlimit)
59 + return;
60 +
61 if(!changes_neighborhood &&
62 !changes_topology &&
63 !changes_hna)
64 @@ -171,11 +177,6 @@
65 olsr_calculate_routing_table();
66 olsr_calculate_hna_routes();
67 }
68 -
69 - else
70 - {
71 - olsr_calculate_lq_routing_table();
72 - }
73 }
74
75 else if (changes_topology)
76 @@ -187,11 +188,6 @@
77 olsr_calculate_routing_table();
78 olsr_calculate_hna_routes();
79 }
80 -
81 - else
82 - {
83 - olsr_calculate_lq_routing_table();
84 - }
85 }
86
87 else if (changes_hna)
88 @@ -202,11 +198,11 @@
89 {
90 olsr_calculate_hna_routes();
91 }
92 -
93 - else
94 - {
95 - olsr_calculate_lq_routing_table();
96 - }
97 + }
98 +
99 + if (olsr_cnf->lq_level >= 2)
100 + {
101 + olsr_calculate_lq_routing_table();
102 }
103
104 if (olsr_cnf->debug_level > 0)
105 @@ -239,6 +235,7 @@
106 changes_neighborhood = OLSR_FALSE;
107 changes_topology = OLSR_FALSE;
108 changes_hna = OLSR_FALSE;
109 + changes_force = OLSR_FALSE;
110
111
112 return;
113 diff -Nur olsrd-0.4.10.orig/src/olsr.h olsrd-0.4.10/src/olsr.h
114 --- olsrd-0.4.10.orig/src/olsr.h 2005-05-29 14:47:45.000000000 +0200
115 +++ olsrd-0.4.10/src/olsr.h 2006-03-02 02:13:02.000000000 +0100
116 @@ -49,6 +49,7 @@
117 extern olsr_bool changes_topology;
118 extern olsr_bool changes_neighborhood;
119 extern olsr_bool changes_hna;
120 +extern olsr_bool changes_force;
121
122 void
123 register_pcf(int (*)(int, int, int));
124 diff -Nur olsrd-0.4.10.orig/src/scheduler.c olsrd-0.4.10/src/scheduler.c
125 --- olsrd-0.4.10.orig/src/scheduler.c 2005-12-29 23:34:37.000000000 +0100
126 +++ olsrd-0.4.10/src/scheduler.c 2006-03-02 02:12:40.000000000 +0100
127 @@ -70,6 +70,7 @@
128
129 changes_neighborhood = OLSR_TRUE;
130 changes_topology = OLSR_TRUE;
131 + changes_force = OLSR_TRUE;
132 }
133
134 /**