[4279] in linux-net channel archive
No subject found in mail header
daemon@ATHENA.MIT.EDU (news)
Tue Sep 3 17:10:03 1996
Date: Tue, 3 Sep 96 15:22 MET DST
From: news@inka.de (news)
To: submit-linux-dev-net@ratatosk.yggdrasil.com
Newsgroups: linux.dev.net
Path: news.ka.inka.de!not-for-mail
From: olaf@inka.de (Olaf Titz)
Subject: request-route improvement
Message-ID: <dx5rtx.3i7@inka.de>
Date: 03 Sep 1996 15:22:45 +0200
Organization: INKA e.V., Karlsruhe
Lines: 50
Reply-To: olaf@bigred.inka.de
NNTP-Posting-Host: tapac.inka.de
When a route isn't found and kerneld is available, first
/sbin/request-route gets called and then "no route to host" is
returned, regardless of whether the script has in fact established the
route. If the packet causing the request was an outgoing SYN, this
means the connection fails unnecessarily.
The following small patch retries obtaining the route after calling
kerneld up to three times. This is sub-optimal (it really should check
the return code of request-route) but easy, and it can help for
dial-on-demand applications. (Not retrying if the first attempt failed
can also be coded into the request-route script.)
olaf
--- net/ipv4/route.c.orig Mon May 27 12:09:06 1996
+++ net/ipv4/route.c Fri Aug 23 20:43:26 1996
@@ -1399,11 +1399,17 @@
struct fib_node * f;
struct fib_info * fi;
__u32 saddr;
+#ifdef CONFIG_KERNELD
+ int rrcnt=3;
+#endif
#if RT_CACHE_DEBUG >= 2
printk("rt_cache miss @%08x\n", daddr);
#endif
+#ifdef CONFIG_KERNELD
+ restart:
+#endif
rth = kmalloc(sizeof(struct rtable), GFP_ATOMIC);
if (!rth)
{
@@ -1438,6 +1444,10 @@
(int)(daddr >> 24) & 0xff, (int)(daddr >> 16) & 0xff,
(int)(daddr >> 8) & 0xff, (int)daddr & 0xff);
kerneld_route(wanted_route); /* Dynamic route request */
+ if (--rrcnt>0) {
+ ip_rt_fast_lock();
+ goto restart;
+ }
#endif
return NULL;
}
--
___ Olaf.Titz@inka.de or @{stud,informatik}.uni-karlsruhe.de ____
__ o <URL:http://www.inka.de/~bigred/> <IRC:praetorius>
__/<_ >> Just as long as the wheels keep on turning round
_)>(_)______________ I will live for the groove 'til the sun goes down << ____