From: mpi Date: Tue, 26 May 2015 15:34:00 +0000 (+0000) Subject: Use if_output() instead of rerolling it. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e9188d0dfea386f14091514d8cc5403908bb5a22;p=openbsd Use if_output() instead of rerolling it. ok stsp@ --- diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index c4e29f3f666..aae984764dd 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_input.c,v 1.133 2015/03/14 03:38:51 jsg Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.134 2015/05/26 15:34:00 mpi Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe @@ -827,7 +827,6 @@ ieee80211_deliver_data(struct ieee80211com *ic, struct mbuf *m, !(ic->ic_flags & IEEE80211_F_NOBRIDGE) && eh->ether_type != htons(ETHERTYPE_PAE)) { struct ieee80211_node *ni1; - int error, len; if (ETHER_IS_MULTICAST(eh->ether_dhost)) { m1 = m_copym2(m, 0, M_COPYALL, M_DONTWAIT); @@ -844,16 +843,8 @@ ieee80211_deliver_data(struct ieee80211com *ic, struct mbuf *m, } } if (m1 != NULL) { - len = m1->m_pkthdr.len; - IFQ_ENQUEUE(&ifp->if_snd, m1, NULL, error); - if (error) - ifp->if_oerrors++; - else { - if (m != NULL) - ifp->if_omcasts++; - ifp->if_obytes += len; - if_start(ifp); - } + if (if_output(ifp, m1)) + ifp->if_oerrors++; } } #endif diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index cadb64ca354..82bd609d2e5 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_output.c,v 1.94 2015/03/14 03:38:51 jsg Exp $ */ +/* $OpenBSD: ieee80211_output.c,v 1.95 2015/05/26 15:34:00 mpi Exp $ */ /* $NetBSD: ieee80211_output.c,v 1.13 2004/05/31 11:02:55 dyoung Exp $ */ /*- @@ -113,8 +113,7 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, { struct ieee80211_frame *wh; struct m_tag *mtag; - int s, len, error = 0; - u_short mflags; + int error = 0; /* Interface has to be up and running */ if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) != @@ -143,30 +142,7 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, IEEE80211_FC0_TYPE_CTL) return (EINVAL); - /* - * Queue message on interface without adding any - * further headers, and start output if interface not - * yet active. - */ - mflags = m->m_flags; - len = m->m_pkthdr.len; - s = splnet(); - IFQ_ENQUEUE(&ifp->if_snd, m, NULL, error); - if (error) { - /* mbuf is already freed */ - splx(s); - printf("%s: failed to queue raw tx frame\n", - ifp->if_xname); - return (error); - } - ifp->if_obytes += len; - if (mflags & M_MCAST) - ifp->if_omcasts++; - if ((ifp->if_flags & IFF_OACTIVE) == 0) - (*ifp->if_start)(ifp); - splx(s); - - return (error); + return (if_output(ifp, m)); } fallback: