[email protected]
[Top] [All Lists]

PERFORCE change 114288 for review

Subject: PERFORCE change 114288 for review
From: Sepherosa Ziehau
Date: Fri, 9 Feb 2007 12:53:18 GMT
http://perforce.freebsd.org/chv.cgi?CH=114288

Change 114288 by [email protected]_zealot:sam_wifi on 2007/02/09 12:52:33

        Avoid possible mbuf re-tap on error path.
        Obtained-from:  DragonFly

Affected files ...

.. //depot/projects/wifi/sys/net80211/ieee80211_input.c#80 edit

Differences ...

==== //depot/projects/wifi/sys/net80211/ieee80211_input.c#80 (text+ko) ====

@@ -139,7 +139,7 @@
        struct ieee80211_frame *wh;
        struct ieee80211_key *key;
        struct ether_header *eh;
-       int hdrspace;
+       int hdrspace, need_tap;
        u_int8_t dir, type, subtype;
        u_int8_t *bssid;
        u_int16_t rxseq;
@@ -152,6 +152,7 @@
                m_adj(m, -IEEE80211_CRC_LEN);
                m->m_flags &= ~M_HASFCS;
        }
+       need_tap = 1;                   /* mbuf need to be tapped. */
        type = -1;                      /* undefined */
        /*
         * In monitor mode, send everything directly to bpf.
@@ -427,6 +428,7 @@
                /* copy to listener after decrypt */
                if (bpf_peers_present(ic->ic_rawbpf))
                        bpf_mtap(ic->ic_rawbpf, m);
+               need_tap = 0;
 
                /*
                 * Finally, strip the 802.11 header.
@@ -588,7 +590,7 @@
        ifp->if_ierrors++;
 out:
        if (m != NULL) {
-               if (bpf_peers_present(ic->ic_rawbpf))
+               if (bpf_peers_present(ic->ic_rawbpf) && need_tap)
                        bpf_mtap(ic->ic_rawbpf, m);
                m_freem(m);
        }
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/p4-projects
To unsubscribe, send any mail to "[email protected]"

<Prev in Thread] Current Thread [Next in Thread>
  • PERFORCE change 114288 for review, Sepherosa Ziehau <=