From 1bb7e8765c2b70fde8e37ffe2e51ce510aefefb2 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Tue, 7 Apr 2009 21:11:59 +0800 Subject: [PATCH] Put ifnet.if_serializer assertion under FIX_SERIALIZE_ASSERT --- sys/net/if.c | 4 ++++ sys/net/if_ethersubr.c | 8 ++++++++ sys/net/if_media.c | 2 ++ 3 files changed, 14 insertions(+) diff --git a/sys/net/if.c b/sys/net/if.c index 812bc58ccb..e86ff1f9bc 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -372,7 +372,9 @@ if_devstart(struct ifnet *ifp) struct ifaltq *ifq = &ifp->if_snd; int running = 0; +#ifdef FIX_SERIALIZE_ASSERT ASSERT_SERIALIZED(ifp->if_serializer); +#endif ALTQ_LOCK(ifq); if (ifq->altq_started || !ifq_data_ready(ifq)) { @@ -2121,7 +2123,9 @@ ifq_dispatch(struct ifnet *ifp, struct mbuf *m, struct altq_pktattr *pa) struct ifaltq *ifq = &ifp->if_snd; int running = 0, error, start = 0; +#ifdef FIX_SERIALIZE_ASSERT ASSERT_NOT_SERIALIZED(ifp->if_serializer); +#endif ALTQ_LOCK(ifq); error = ifq_enqueue_locked(ifq, m, pa); diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 0850e43a68..cd06c9ad63 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -218,7 +218,9 @@ ether_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct arpcom *ac = IFP2AC(ifp); int error; +#ifdef FIX_SERIALIZE_ASSERT ASSERT_NOT_SERIALIZED(ifp->if_serializer); +#endif if (ifp->if_flags & IFF_MONITOR) gotoerr(ENETDOWN); @@ -483,7 +485,9 @@ ether_output_frame(struct ifnet *ifp, struct mbuf *m) int error = 0; struct altq_pktattr pktattr; +#ifdef FIX_SERIALIZE_ASSERT ASSERT_NOT_SERIALIZED(ifp->if_serializer); +#endif if (m->m_pkthdr.fw_flags & DUMMYNET_MBUF_TAGGED) { struct m_tag *mtag; @@ -697,7 +701,9 @@ do { \ } \ } while (0) +#ifdef FIX_SERIALIZE_ASSERT ASSERT_SERIALIZED(ifp->if_serializer); +#endif switch (command) { case SIOCSIFADDR: @@ -1616,7 +1622,9 @@ ether_input_chain(struct ifnet *ifp, struct mbuf *m, const struct pktinfo *pi, uint16_t ether_type; int isr; +#ifdef FIX_SERIALIZE_ASSERT ASSERT_SERIALIZED(ifp->if_serializer); +#endif M_ASSERTPKTHDR(m); /* Discard packet if interface is not up */ diff --git a/sys/net/if_media.c b/sys/net/if_media.c index 7514b17406..c56c9faf2f 100644 --- a/sys/net/if_media.c +++ b/sys/net/if_media.c @@ -188,7 +188,9 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, if (ifp == NULL || ifr == NULL || ifm == NULL) return (EINVAL); +#ifdef FIX_SERIALIZE_ASSERT ASSERT_SERIALIZED(ifp->if_serializer); +#endif switch (cmd) { /* -- 2.41.0