summaryrefslogtreecommitdiff
path: root/sys/net80211
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2010-06-05 13:13:44 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2010-06-05 13:13:44 +0000
commitbca605048ac69dd75d1762831fc7e489f90404f7 (patch)
tree275893991a9b425f77caa8bddb34af0358a81822 /sys/net80211
parent983252fae5e208ffbc6f76adb2b94ee4a9300bae (diff)
there is no need to copy the full 802.11 header in ieee80211_decap()
as we do not use any field after i_addr4. slightly modified version of a diff from Matthew Dempsky (matthew at dempsky dot org), used MIN instead of min.
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_input.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index 33d377751a0..46c9eb0da55 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_input.c,v 1.113 2010/02/25 17:49:16 damien Exp $ */
+/* $OpenBSD: ieee80211_input.c,v 1.114 2010/06/05 13:13:43 damien Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -902,7 +902,7 @@ void
ieee80211_decap(struct ieee80211com *ic, struct mbuf *m,
struct ieee80211_node *ni, int hdrlen)
{
- struct ieee80211_qosframe_addr4 wh; /* largest 802.11 header */
+ struct ieee80211_frame_addr4 wh;
struct ether_header *eh;
struct llc *llc;
@@ -911,7 +911,7 @@ ieee80211_decap(struct ieee80211com *ic, struct mbuf *m,
ic->ic_stats.is_rx_decap++;
return;
}
- memcpy(&wh, mtod(m, caddr_t), hdrlen);
+ memcpy(&wh, mtod(m, caddr_t), MIN(hdrlen, sizeof(wh)));
llc = (struct llc *)(mtod(m, caddr_t) + hdrlen);
if (llc->llc_dsap == LLC_SNAP_LSAP &&
llc->llc_ssap == LLC_SNAP_LSAP &&