Date: Mon, 15 May 1995 08:31:51 +0200 (MET DST) From: Pierre Beyssac <pb@fasterix.freenix.fr> To: freebsd-bugs@freefall.cdrom.com Cc: freebsd-current@freefall.cdrom.com Subject: panic in rtfree(): even more info Message-ID: <199505150631.LAA05342@fasterix.frmug.fr.net>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199505150631.LAA05342>
