From owner-freebsd-bugs Mon May 15 03:08:43 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id DAA24695 for bugs-outgoing; Mon, 15 May 1995 03:08:43 -0700 Received: from jabba.fdn.org (jabba.fdn.org [193.55.4.70]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id DAA24569 ; Mon, 15 May 1995 03:05:48 -0700 Received: (from uucp@localhost) by jabba.fdn.org (8.6.8/8.6.9) with UUCP id MAA06686; Mon, 15 May 1995 12:05:39 +0200 Received: (pb@localhost) by fasterix.frmug.fr.net (8.6.11/fasterix-941011) id LAA05342; Mon, 15 May 1995 08:31:52 +0200 From: Pierre Beyssac Message-Id: <199505150631.LAA05342@fasterix.frmug.fr.net> Subject: panic in rtfree(): even more info To: freebsd-bugs@freefall.cdrom.com Date: Mon, 15 May 1995 08:31:51 +0200 (MET DST) Cc: freebsd-current@freefall.cdrom.com X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 2394 Sender: bugs-owner@FreeBSD.org Precedence: bulk More info on the rtfree() panic. The problems seem due to Friday's patch to rtsock.c. I reversed part of this patch and the problems went away. Here are the diffs between the "official" current rtsock.c and the one I use. This is not actually a fix, rather a patch to reverse most of Friday's change. Certainly not all of this is necessary, I provide this merely for info and will slowly reintegrate the -current rtsock.c to see when the rtfree panic reappears. --- rtsock.c.ctm Thu May 11 09:39:37 1995 +++ rtsock.c Mon May 15 00:23:43 1995 @@ -185,38 +185,64 @@ if (error == 0 && saved_nrt) { rt_setmetrics(rtm->rtm_inits, &rtm->rtm_rmx, &saved_nrt->rt_rmx); saved_nrt->rt_refcnt--; saved_nrt->rt_genmask = genmask; } break; case RTM_DELETE: error = rtrequest(RTM_DELETE, dst, gate, netmask, +#if 1 + rtm->rtm_flags, (struct rtentry **)0); +#else /* RTFREE_BUG */ rtm->rtm_flags, &saved_nrt); if (error == 0) { if ((rt = saved_nrt)->rt_refcnt <= 0) rt->rt_refcnt++; goto report; } +#endif /* RTFREE_BUG */ break; case RTM_GET: case RTM_CHANGE: case RTM_LOCK: +#if 1 + rt = rtalloc1(dst, 0, 0UL); + if (rt == 0) +#else /* RTFREE_BUG */ if ((rnh = rt_tables[dst->sa_family]) == 0) { senderr(EAFNOSUPPORT); } else if (rt = (struct rtentry *) rnh->rnh_lookup(dst, netmask, rnh)) rt->rt_refcnt++; else +#endif /* RTFREE_BUG */ senderr(ESRCH); +#if 1 + if (rtm->rtm_type != RTM_GET) {/* XXX: too grotty */ + struct radix_node *rn; + + if (Bcmp(dst, rt_key(rt), dst->sa_len) != 0) + senderr(ESRCH); + if (netmask && (rn = rn_search(netmask, + mask_rnhead->rnh_treetop))) + netmask = (struct sockaddr *)rn->rn_key; + for (rn = rt->rt_nodes; rn; rn = rn->rn_dupedkey) + if (netmask == (struct sockaddr *)rn->rn_mask) + break; + if (rn == 0) + senderr(ETOOMANYREFS); + rt = (struct rtentry *)rn; + } +#endif /* not RTFREE_BUG */ switch(rtm->rtm_type) { case RTM_GET: report: dst = rt_key(rt); gate = rt->rt_gateway; netmask = rt_mask(rt); genmask = rt->rt_genmask; if (rtm->rtm_addrs & (RTA_IFP | RTA_IFA)) { ifp = rt->rt_ifp; -- Pierre Beyssac pb@fasterix.frmug.fr.net pb@fasterix.fdn.fr FreeBSD, NetBSD, Linux -- Il y a moins bien, mais c'est plus cher. You can also get less bang for more bucks. (translation F. Berjon)