packages/net/olsrd/patches/130-olsrd_fixes.patch
nbd c534fa71b7 rename olsrd patches, add fixes and optimizations from sven-ola
git-svn-id: svn://svn.openwrt.org/openwrt/packages@4965 3c298f89-4303-0410-b956-a3cf2f4a3e73
2006-10-08 17:04:09 +00:00

135 lines
4.0 KiB
Diff

diff -Nur olsrd-0.4.10.orig/src/defs.h olsrd-0.4.10/src/defs.h
--- olsrd-0.4.10.orig/src/defs.h 2006-01-01 16:59:02.000000000 +0100
+++ olsrd-0.4.10/src/defs.h 2006-03-02 02:10:02.000000000 +0100
@@ -71,7 +71,7 @@
#define HOPCNT_MAX 32 /* maximum hops number */
#define MAXMESSAGESIZE 1500 /* max broadcast size */
#define UDP_IPV4_HDRSIZE 28
-#define UDP_IPV6_HDRSIZE 48
+#define UDP_IPV6_HDRSIZE 62
#define MAX_IFS 16
/* Debug helper macro */
diff -Nur olsrd-0.4.10.orig/src/link_set.c olsrd-0.4.10/src/link_set.c
--- olsrd-0.4.10.orig/src/link_set.c 2005-11-17 05:25:44.000000000 +0100
+++ olsrd-0.4.10/src/link_set.c 2006-03-02 02:10:02.000000000 +0100
@@ -952,8 +952,9 @@
entry->loss_link_quality =
(float)(entry->total_packets - entry->lost_packets) /
- (float)(entry->loss_window_size);
-
+ (float)(entry->loss_window_size < (2 * 4) ? entry->loss_window_size:
+ 4 * ((entry->loss_window_size / 4 - 1) * entry->total_packets + entry->loss_window_size) / entry->loss_window_size);
+
// multiply the calculated link quality with the user-specified multiplier
entry->loss_link_quality *= entry->loss_link_multiplier;
diff -Nur olsrd-0.4.10.orig/src/lq_packet.c olsrd-0.4.10/src/lq_packet.c
--- olsrd-0.4.10.orig/src/lq_packet.c 2005-11-17 02:58:51.000000000 +0100
+++ olsrd-0.4.10/src/lq_packet.c 2006-03-02 02:10:02.000000000 +0100
@@ -149,7 +149,8 @@
int i;
struct neighbor_entry *walker;
struct link_entry *link;
- static int ttl_list[] = { MAX_TTL, 3, 2, 1, 2, 1, 1, 3, 2, 1, 2, 1, 1, 0 };
+ static int ttl_list[] = { 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, MAX_TTL-1, 0};
+
static int ttl_index = 0;
// remember that we have generated an LQ TC message; this is
diff -Nur olsrd-0.4.10.orig/src/olsr.c olsrd-0.4.10/src/olsr.c
--- olsrd-0.4.10.orig/src/olsr.c 2005-11-17 05:25:44.000000000 +0100
+++ olsrd-0.4.10/src/olsr.c 2006-03-02 02:16:42.000000000 +0100
@@ -68,6 +68,7 @@
olsr_bool changes_topology;
olsr_bool changes_neighborhood;
olsr_bool changes_hna;
+olsr_bool changes_force;
/**
* Process changes functions
@@ -142,6 +143,11 @@
OLSR_PRINTF(3, "CHANGES IN HNA\n")
#endif
+ if(!changes_force &&
+ 2 <= olsr_cnf->lq_level &&
+ 0 >= olsr_cnf->lq_dlimit)
+ return;
+
if(!changes_neighborhood &&
!changes_topology &&
!changes_hna)
@@ -171,11 +177,6 @@
olsr_calculate_routing_table();
olsr_calculate_hna_routes();
}
-
- else
- {
- olsr_calculate_lq_routing_table();
- }
}
else if (changes_topology)
@@ -187,11 +188,6 @@
olsr_calculate_routing_table();
olsr_calculate_hna_routes();
}
-
- else
- {
- olsr_calculate_lq_routing_table();
- }
}
else if (changes_hna)
@@ -202,11 +198,11 @@
{
olsr_calculate_hna_routes();
}
-
- else
- {
- olsr_calculate_lq_routing_table();
- }
+ }
+
+ if (olsr_cnf->lq_level >= 2)
+ {
+ olsr_calculate_lq_routing_table();
}
if (olsr_cnf->debug_level > 0)
@@ -239,6 +235,7 @@
changes_neighborhood = OLSR_FALSE;
changes_topology = OLSR_FALSE;
changes_hna = OLSR_FALSE;
+ changes_force = OLSR_FALSE;
return;
diff -Nur olsrd-0.4.10.orig/src/olsr.h olsrd-0.4.10/src/olsr.h
--- olsrd-0.4.10.orig/src/olsr.h 2005-05-29 14:47:45.000000000 +0200
+++ olsrd-0.4.10/src/olsr.h 2006-03-02 02:13:02.000000000 +0100
@@ -49,6 +49,7 @@
extern olsr_bool changes_topology;
extern olsr_bool changes_neighborhood;
extern olsr_bool changes_hna;
+extern olsr_bool changes_force;
void
register_pcf(int (*)(int, int, int));
diff -Nur olsrd-0.4.10.orig/src/scheduler.c olsrd-0.4.10/src/scheduler.c
--- olsrd-0.4.10.orig/src/scheduler.c 2005-12-29 23:34:37.000000000 +0100
+++ olsrd-0.4.10/src/scheduler.c 2006-03-02 02:12:40.000000000 +0100
@@ -70,6 +70,7 @@
changes_neighborhood = OLSR_TRUE;
changes_topology = OLSR_TRUE;
+ changes_force = OLSR_TRUE;
}
/**