summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2005-08-24 18:10:51 +0000
committerRobert Watson <rwatson@FreeBSD.org>2005-08-24 18:10:51 +0000
commit89348f94f0a98dae8544273622b36f1d6ea61dff (patch)
tree9b45c647d0d32f5265503d58e81ec950ca75e597
parentad82081bf14ab7c501f950a96cbb869b579bb630 (diff)
Notes
-rw-r--r--sys/net/if_atmsubr.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c
index b08f3e6ea03b..1e8a0d82e613 100644
--- a/sys/net/if_atmsubr.c
+++ b/sys/net/if_atmsubr.c
@@ -259,9 +259,6 @@ atm_input(struct ifnet *ifp, struct atm_pseudohdr *ah, struct mbuf *m,
{
int isr;
u_int16_t etype = ETHERTYPE_IP; /* default */
-#ifdef NATM
- int s;
-#endif
if ((ifp->if_flags & IFF_UP) == 0) {
m_freem(m);
@@ -287,13 +284,19 @@ atm_input(struct ifnet *ifp, struct atm_pseudohdr *ah, struct mbuf *m,
if (rxhand) {
#ifdef NATM
- struct natmpcb *npcb = rxhand;
+ struct natmpcb *npcb;
- s = splimp(); /* in case 2 atm cards @ diff lvls */
+ /*
+ * XXXRW: this use of 'rxhand' is not a very good idea, and
+ * was subject to races even before SMPng due to the release
+ * of spl here.
+ */
+ NATM_LOCK();
+ npcb = rxhand;
npcb->npcb_inq++; /* count # in queue */
- splx(s);
isr = NETISR_NATM;
m->m_pkthdr.rcvif = rxhand; /* XXX: overload */
+ NATM_UNLOCK();
#else
printf("atm_input: NATM detected but not "
"configured in kernel\n");