Re: kerneld_route gone?

Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
21 Nov 1997 11:25:26 +0100


Pablo Bianucci <pbian@pccp.com.ar> writes:

|> This is probably old, but I seems that since 2.1.15 the automatic kerneld
|> setup of non-existant routes has been removed. I am quite used to it (I
|> use it with the 2.0.x kernels) and I would like to keep on using it.

Please try this:

--- linux/net/ipv4/route.c.~1~ Mon Jul 28 17:33:37 1997
+++ linux/net/ipv4/route.c Wed Nov 19 21:37:59 1997
@@ -85,6 +85,10 @@

#define CONFIG_IP_LOCAL_RT_POLICY 1

+#ifdef CONFIG_KERNELD
+#include <linux/kerneld.h>
+#endif
+
static void rt_run_flush(unsigned long);

static struct timer_list rt_flush_timer =
@@ -1193,8 +1197,21 @@
daddr = htonl(INADDR_LOOPBACK);

#ifdef CONFIG_IP_LOCAL_RT_POLICY
- if (fib_lookup(&res, daddr, saddr, tos, &loopback_dev, dev_out))
+ if (fib_lookup(&res, daddr, saddr, tos, &loopback_dev, dev_out)) {
+#ifndef CONFIG_KERNELD
return -ENETUNREACH;
+#else
+ char wanted_route[20];
+
+ daddr = ntohl(daddr);
+ sprintf(wanted_route, "%d.%d.%d.%d",
+ (int)(daddr >> 24) & 0xff, (int)(daddr >> 16) & 0xff,
+ (int)(daddr >> 8) & 0xff, (int)daddr & 0xff);
+ kerneld_route(wanted_route); /* Dynamic route request */
+ if (fib_lookup(&res, daddr, saddr, tos, &loopback_dev, dev_out))
+ return -ENETUNREACH;
+#endif
+ }
fi = res.f->fib_info;
dst_map = daddr;

@@ -1216,6 +1233,18 @@
}
#else
fi = fib_lookup_info(daddr, 0, tos, &loopback_dev, dev_out);
+#ifdef CONFIG_KERNELD
+ if (!fi) {
+ char wanted_route[20];
+
+ daddr = ntohl(daddr);
+ sprintf(wanted_route, "%d.%d.%d.%d",
+ (int)(daddr >> 24) & 0xff, (int)(daddr >> 16) & 0xff,
+ (int)(daddr >> 8) & 0xff, (int)daddr & 0xff);
+ kerneld_route(wanted_route); /* Dynamic route request */
+ fi = fib_lookup_info(daddr, 0, tos, &loopback_dev, dev_out);
+ }
+#endif
if (!fi)
return -ENETUNREACH;

-- 
Andreas Schwab                                      "And now for something
schwab@issan.informatik.uni-dortmund.de              completely different"
schwab@gnu.org