[Olsr-dev] experimental PATCH to remove errors on inserting routes into kernel on startup or new neighbours
Markus Kittenberger
(spam-protected)
Sun Dec 14 21:50:35 CET 2008
as bernd already found out a while ago, sometimes oslrd tries to insert
routes (via a gateway), but has never insert a route to the gateway before
this clearly is rejected by the kernel,..
after some debugging, checking rib and spf, i realaised that the problem
only occures with neighbours having multiple interfaces (and multiple ip
adresses)
and only when there is no mid mesage before this neighbour gets used by
spf,..
so i created following patch which detects the alias ip of single hop
neighbours on the fly,..
BUT: it`s a bit dirty and may break rfc, i guess!!!
but: since i applied the patch no error like this came up
KERN: ERROR adding 78.41.112.7/32 from 78.41.112.7 via 193.238.159.57, cost
1.65, metric 2, v 6: No such process
usually tousand of this happenper minute, when starting olsrd under my test
conditions (=devVserver)
following patch already got pushed to tip,.
diff -r fab0ca5a173a src/mid_set.c
--- a/src/mid_set.c Sun Dec 14 20:58:33 2008 +0100
+++ b/src/mid_set.c Sun Dec 14 21:31:20 2008 +0100
@@ -53,7 +53,6 @@
#include <stdlib.h>
-static struct mid_entry *olsr_lookup_mid_entry(const union olsr_ip_addr *);
static void olsr_prune_mid_entries(const union olsr_ip_addr *main_addr,
uint16_t mid_seqno);
static void olsr_flush_mid_entries(struct tc_entry *);
@@ -221,7 +220,7 @@
* @param vtime the validity time
* @param seq the sequence number to register a new node with
*/
-static struct mid_entry *
+struct mid_entry *
olsr_insert_mid_entry(const union olsr_ip_addr *main_addr,
const union olsr_ip_addr *alias_addr,
olsr_reltime vtime,
@@ -286,7 +285,7 @@
* @param vtime the validity time
* @param seq the sequence number to register a new node with
*/
-static void
+void
olsr_update_mid_entry(const union olsr_ip_addr *main_addr,
const union olsr_ip_addr *alias_addr,
olsr_reltime vtime, uint16_t mid_seqno)
@@ -352,7 +351,7 @@
* @param adr the alias address to check
* @return the MID address entry or NULL if not found
*/
-static struct mid_entry *
+struct mid_entry *
olsr_lookup_mid_entry(const union olsr_ip_addr *adr)
{
#if 0
diff -r fab0ca5a173a src/mid_set.h
--- a/src/mid_set.h Sun Dec 14 20:58:33 2008 +0100
+++ b/src/mid_set.h Sun Dec 14 21:31:20 2008 +0100
@@ -89,6 +89,18 @@
const union olsr_ip_addr *);
void olsr_print_mid_set(void);
+/*used by routing upspeed hack*/
+struct mid_entry *olsr_lookup_mid_entry(const union olsr_ip_addr *);
+void olsr_update_mid_entry(const union olsr_ip_addr *,
+ const union olsr_ip_addr *,
+ olsr_reltime,
+ uint16_t);
+struct mid_entry * olsr_insert_mid_entry(const union olsr_ip_addr *,
+ const union olsr_ip_addr *,
+ olsr_reltime,
+ uint16_t);
+
+
#endif
/*
diff -r fab0ca5a173a src/tc_set.c
--- a/src/tc_set.c Sun Dec 14 20:58:33 2008 +0100
+++ b/src/tc_set.c Sun Dec 14 21:31:20 2008 +0100
@@ -41,6 +41,7 @@
*/
#include "tc_set.h"
+#include "mid_set.h"
#include "olsr.h"
#include "lq_packet.h"
#include "net_olsr.h"
@@ -772,6 +773,22 @@
tc = olsr_lookup_tc_entry(&originator);
+/*learn alias ips of neighbours on the fly to speed up things!!*/
+ if (msg_hops==0) {
+ if (!ipequal(&originator,from_addr)){
+ /*new alias of new neighbour are thrown in the mid table to speed up
routing*/
+ if (olsr_validate_address(from_addr)) {
+ if (!olsr_lookup_mid_entry(from_addr)){
+ struct ipaddr_str srcbuf, origbuf;
+ OLSR_PRINTF(1, "got tc from from unknown alias ip of direct neighbour: ip:
%s main-ip: %s\n",
+ olsr_ip_to_string(&origbuf,&originator),
+ olsr_ip_to_string(&srcbuf,from_addr));
+ olsr_insert_mid_entry(&originator, from_addr, vtime, msg_seq);
+ }
+ }
+ }
+ }
+
if (tc && 0 != tc->edge_tree.count) {
if (olsr_seq_inrange_high((int)tc->msg_seq - TC_SEQNO_WINDOW,
tc->msg_seq,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.olsr.org/pipermail/olsr-dev/attachments/20081214/5fe142b7/attachment.html>
More information about the Olsr-dev
mailing list