PERFORCE change 45406 for review
Sam Leffler
sam at FreeBSD.org
Thu Jan 15 12:54:03 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=45406
Change 45406 by sam at sam_ebb on 2004/01/15 12:53:09
o consolidate the logic to enable WEP in ieee80211_encap
o don't enable WEP for EAPOL frames for 802.1x (not exactly
right but close enough for now)
o add equivalent logic to awi's private encapsulation code
Affected files ...
.. //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#15 edit
.. //depot/projects/netperf+sockets/sys/dev/awi/awi.c#3 edit
.. //depot/projects/netperf+sockets/sys/dev/wi/if_wi.c#5 edit
.. //depot/projects/netperf+sockets/sys/net/ethernet.h#3 edit
.. //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#4 edit
Differences ...
==== //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#15 (text+ko) ====
@@ -789,8 +789,6 @@
goto bad;
}
wh = mtod(m, struct ieee80211_frame *);
- if (ic->ic_flags & IEEE80211_F_WEPON)
- wh->i_fc[1] |= IEEE80211_FC1_WEP;
} else {
/*
* Hack! The referenced node pointer is in the
==== //depot/projects/netperf+sockets/sys/dev/awi/awi.c#3 (text+ko) ====
@@ -744,7 +744,7 @@
struct ieee80211_node *ni;
struct ieee80211_frame *wh;
struct mbuf *m, *m0;
- int len, dowep;
+ int len;
u_int32_t txd, frame, ntxd;
u_int8_t rate;
@@ -754,7 +754,6 @@
for (;;) {
txd = sc->sc_txnext;
IF_POLL(&ic->ic_mgtq, m0);
- dowep = 0;
if (m0 != NULL) {
len = m0->m_pkthdr.len;
if (awi_next_txd(sc, len, &frame, &ntxd)) {
@@ -762,6 +761,7 @@
break;
}
IF_DEQUEUE(&ic->ic_mgtq, m0);
+ wh = mtod(m0, struct ieee80211_frame *);
} else {
if (ic->ic_state != IEEE80211_S_RUN)
break;
@@ -777,7 +777,6 @@
len += sizeof(struct llc) -
sizeof(struct ether_header);
if (ic->ic_flags & IEEE80211_F_WEPON) {
- dowep = 1;
len += IEEE80211_WEP_IVLEN +
IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN;
}
@@ -818,7 +817,7 @@
if (ic->ic_rawbpf)
bpf_mtap(ic->ic_rawbpf, m0);
#endif
- if (dowep) {
+ if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
if ((m0 = ieee80211_wep_crypt(ifp, m0, 1)) == NULL) {
ifp->if_oerrors++;
continue;
@@ -2154,6 +2153,10 @@
IEEE80211_ADDR_COPY(wh->i_addr2, eh->ether_shost);
IEEE80211_ADDR_COPY(wh->i_addr3, eh->ether_dhost);
}
+ /* NB: EAPOL frames have their own encryption policy */
+ if (ic->ic_flags & IEEE80211_F_WEPON &&
+ eh.ether_type != ETHERTYPE_EAPOL)
+ wh->i_fc[1] |= IEEE80211_FC1_WEP;
return m;
}
==== //depot/projects/netperf+sockets/sys/dev/wi/if_wi.c#5 (text+ko) ====
@@ -921,9 +921,6 @@
continue;
}
wh = mtod(m0, struct ieee80211_frame *);
- if (ic->ic_flags & IEEE80211_F_WEPON)
- wh->i_fc[1] |= IEEE80211_FC1_WEP;
-
}
#if NBPFILTER > 0
if (ic->ic_rawbpf)
==== //depot/projects/netperf+sockets/sys/net/ethernet.h#3 (text+ko) ====
@@ -319,6 +319,7 @@
#define ETHERTYPE_PPPOEDISC 0x8863 /* PPP Over Ethernet Discovery Stage */
#define ETHERTYPE_PPPOE 0x8864 /* PPP Over Ethernet Session Stage */
#define ETHERTYPE_LANPROBE 0x8888 /* HP LanProbe test? */
+#define ETHERTYPE_EAPOL 0x888E /* EAPOL/802.1x */
#define ETHERTYPE_LOOPBACK 0x9000 /* Loopback: used to test interfaces */
#define ETHERTYPE_LBACK ETHERTYPE_LOOPBACK /* DEC MOP loopback */
#define ETHERTYPE_XNSSM 0x9001 /* 3Com (Formerly Bridge Communications), XNS Systems Management */
==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#4 (text+ko) ====
@@ -242,6 +242,10 @@
case IEEE80211_M_MONITOR:
goto bad;
}
+ /* NB: EAPOL frames have their own encryption policy */
+ if (ic->ic_flags & IEEE80211_F_WEPON &&
+ eh.ether_type != ETHERTYPE_EAPOL)
+ wh->i_fc[1] |= IEEE80211_FC1_WEP;
*pni = ni;
return m;
bad:
More information about the p4-projects
mailing list