*BSD News Article 62003


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!metro!news.nsw.CSIRO.AU!mel.dit.csiro.au!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!newsfeed.internetmci.com!news.mathworks.com!fu-berlin.de!zib-berlin.de!narses.hrz.tu-chemnitz.de!news.tu-chemnitz.de!irz401!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Please Help: After few days ppp and SLIP stops working?
Date: 20 Feb 1996 22:31:17 GMT
Organization: Private BSD site, Dresden
Lines: 61
Message-ID: <4gdi3l$gsj@uriah.heep.sax.de>
References: <4gc0q2$ndk@giga.bga.com>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.3

tushar@ecpi.com (Tushar Patel) writes:

> I have strange problem, PPP and slip stops operating after few days
> in operation.  If I reboot the FreeBSD machine every thing starts
> working properly.  I am running FreeBSD 2.0.5.

Try this:

Index: /sys/net/route.c
===================================================================
RCS file: /home/cvs/src/sys/net/route.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -u -r1.25 -r1.26
--- route.c	1995/07/29 11:41:02	1.25
+++ route.c	1995/10/16 19:09:40	1.26
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)route.c	8.2 (Berkeley) 11/15/93
- *	$Id: route.c,v 1.25 1995/07/29 11:41:02 bde Exp $
+ *	$Id: route.c,v 1.26 1995/10/16 19:09:40 wollman Exp $
  */
 
 #include <sys/param.h>
@@ -464,6 +464,28 @@
 
 		rn = rnh->rnh_addaddr((caddr_t)ndst, (caddr_t)netmask,
 					rnh, rt->rt_nodes);
+		if (rn == 0) {
+			struct rtentry *rt2;
+			/*
+			 * Uh-oh, we already have one of these in the tree.
+			 * We do a special hack: if the route that's already
+			 * there was generated by the protocol-cloning
+			 * mechanism, then we just blow it away and retry
+			 * the insertion of the new one.
+			 */
+			rt2 = rtalloc1(dst, 0, RTF_PRCLONING);
+			if (rt2 && rt2->rt_parent) {
+				rtrequest(RTM_DELETE, 
+					  (struct sockaddr *)rt_key(rt2),
+					  rt2->rt_gateway,
+					  rt_mask(rt2), rt2->rt_flags, 0);
+				RTFREE(rt2);
+				rn = rnh->rnh_addaddr((caddr_t)ndst,
+						      (caddr_t)netmask,
+						      rnh, rt->rt_nodes);
+			}
+		}
+
 		if (rn == 0) {
 			if (rt->rt_gwroute)
 				rtfree(rt->rt_gwroute);

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)