diff options
author | 2010-06-05 13:13:43 +0000 | |
---|---|---|
committer | 2010-06-05 13:13:43 +0000 | |
commit | b0d27f833c3878e2f934a263167edaa6f2694f40 (patch) | |
tree | e0abdb24ed164727b783f4d2b4894da8ca055579 | |
parent | 'operational' takes a single 'n' (diff) | |
download | wireguard-openbsd-b0d27f833c3878e2f934a263167edaa6f2694f40.tar.xz wireguard-openbsd-b0d27f833c3878e2f934a263167edaa6f2694f40.zip |
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.
-rw-r--r-- | sys/net80211/ieee80211_input.c | 6 |
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 && |