summaryrefslogtreecommitdiffstats
path: root/sys/netinet/if_atm.c
diff options
context:
space:
mode:
authorrodrigc <rodrigc@FreeBSD.org>2005-08-12 02:38:20 +0000
committerrodrigc <rodrigc@FreeBSD.org>2005-08-12 02:38:20 +0000
commita0f768a4ddf4a419957ecffc684f7d211ebf2326 (patch)
tree9ac6dc9fef31109c7db73e189def2c1834b3a7a8 /sys/netinet/if_atm.c
parente0a42961b2423dd06838fbd6b69e60f941ed2305 (diff)
downloadFreeBSD-src-a0f768a4ddf4a419957ecffc684f7d211ebf2326.zip
FreeBSD-src-a0f768a4ddf4a419957ecffc684f7d211ebf2326.tar.gz
Add NATM_LOCK() and NATM_UNLOCK() in places where npcb_add() and
npcb_free() are called, in order to eliminate witness panics. This was overlooked in removal of GIANT from ATM. Reviewed by: rwatson
Diffstat (limited to 'sys/netinet/if_atm.c')
-rw-r--r--sys/netinet/if_atm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/netinet/if_atm.c b/sys/netinet/if_atm.c
index 8093f9a..d37a390 100644
--- a/sys/netinet/if_atm.c
+++ b/sys/netinet/if_atm.c
@@ -144,6 +144,9 @@ atm_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info)
* Parse and verify the link level address as
* an open request
*/
+#ifdef NATM
+ NATM_LOCK();
+#endif
bzero(&op, sizeof(op));
addr = LLADDR(SDL(gate));
alen = SDL(gate)->sdl_alen;
@@ -247,6 +250,9 @@ atm_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info)
SDL(gate)->sdl_type = rt->rt_ifp->if_type;
SDL(gate)->sdl_index = rt->rt_ifp->if_index;
+#ifdef NATM
+ NATM_UNLOCK();
+#endif
break;
failed:
@@ -256,6 +262,7 @@ failed:
rt->rt_llinfo = NULL;
rt->rt_flags &= ~RTF_LLINFO;
}
+ NATM_UNLOCK();
#endif
/* mark as invalid. We cannot RTM_DELETE the route from
* here, because the recursive call to rtrequest1 does
@@ -269,10 +276,12 @@ failed:
* tell native ATM we are done with this VC
*/
if (rt->rt_flags & RTF_LLINFO) {
+ NATM_LOCK();
npcb_free((struct natmpcb *)rt->rt_llinfo,
NPCB_DESTROY);
rt->rt_llinfo = NULL;
rt->rt_flags &= ~RTF_LLINFO;
+ NATM_UNLOCK();
}
#endif
/*
OpenPOWER on IntegriCloud