[PATCH] kerneld demand dialing for 2.1.15

Rob Riggs (rriggs@tesser.com)
Sun, 15 Dec 1996 05:19:07 -0700 (MST)


The following patch re-enables kerneld's dynamic route request
feature in 2.1.15.

Rob
(rriggs@tesser.com)

--- linux-2.1.5/net/ipv4/route.c Sun Dec 15 05:09:51 1996
+++ linux/net/ipv4/route.c Sun Dec 15 05:16:22 1996
@@ -78,6 +78,10 @@
#include <net/sock.h>
#include <net/icmp.h>
#include <linux/net_alias.h>
+
+#ifdef CONFIG_KERNELD
+#include <linux/kerneld.h>
+#endif

static void rt_run_flush(unsigned long);

@@ -1210,8 +1214,18 @@
}
#else
fi = fib_lookup_info(daddr, 0, tos, &loopback_dev, dev_out);
- if (!fi)
+ if (!fi) {
+#ifdef CONFIG_KERNELD
+ 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 */
+#endif
return -ENETUNREACH;
+ }

if (fi->fib_flags&RTF_NAT)
return -EINVAL;