ieee80211_input.c (156367) | ieee80211_input.c (159180) |
---|---|
1/*- 2 * Copyright (c) 2001 Atsushi Onoe 3 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 17 unchanged lines hidden (view full) --- 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 Atsushi Onoe 3 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 17 unchanged lines hidden (view full) --- 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_input.c 156367 2006-03-07 03:55:05Z sam $"); | 34__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_input.c 159180 2006-06-02 19:59:33Z csjp $"); |
35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/mbuf.h> 39#include <sys/malloc.h> 40#include <sys/endian.h> 41#include <sys/kernel.h> 42 --- 374 unchanged lines hidden (view full) --- 417 if (key != NULL && !ieee80211_crypto_demic(ic, key, m, 0)) { 418 IEEE80211_DISCARD_MAC(ic, IEEE80211_MSG_INPUT, 419 ni->ni_macaddr, "data", "%s", "demic error"); 420 IEEE80211_NODE_STAT(ni, rx_demicfail); 421 goto out; 422 } 423 424 /* copy to listener after decrypt */ | 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/mbuf.h> 39#include <sys/malloc.h> 40#include <sys/endian.h> 41#include <sys/kernel.h> 42 --- 374 unchanged lines hidden (view full) --- 417 if (key != NULL && !ieee80211_crypto_demic(ic, key, m, 0)) { 418 IEEE80211_DISCARD_MAC(ic, IEEE80211_MSG_INPUT, 419 ni->ni_macaddr, "data", "%s", "demic error"); 420 IEEE80211_NODE_STAT(ni, rx_demicfail); 421 goto out; 422 } 423 424 /* copy to listener after decrypt */ |
425 if (ic->ic_rawbpf) | 425 if (bpf_peers_present(ic->ic_rawbpf)) |
426 bpf_mtap(ic->ic_rawbpf, m); 427 428 /* 429 * Finally, strip the 802.11 header. 430 */ 431 m = ieee80211_decap(ic, m, hdrspace); 432 if (m == NULL) { 433 /* don't count Null data frames as errors */ --- 97 unchanged lines hidden (view full) --- 531 key = ieee80211_crypto_decap(ic, ni, m, hdrspace); 532 if (key == NULL) { 533 /* NB: stats+msgs handled in crypto_decap */ 534 goto out; 535 } 536 wh = mtod(m, struct ieee80211_frame *); 537 wh->i_fc[1] &= ~IEEE80211_FC1_WEP; 538 } | 426 bpf_mtap(ic->ic_rawbpf, m); 427 428 /* 429 * Finally, strip the 802.11 header. 430 */ 431 m = ieee80211_decap(ic, m, hdrspace); 432 if (m == NULL) { 433 /* don't count Null data frames as errors */ --- 97 unchanged lines hidden (view full) --- 531 key = ieee80211_crypto_decap(ic, ni, m, hdrspace); 532 if (key == NULL) { 533 /* NB: stats+msgs handled in crypto_decap */ 534 goto out; 535 } 536 wh = mtod(m, struct ieee80211_frame *); 537 wh->i_fc[1] &= ~IEEE80211_FC1_WEP; 538 } |
539 if (ic->ic_rawbpf) | 539 if (bpf_peers_present(ic->ic_rawbpf)) |
540 bpf_mtap(ic->ic_rawbpf, m); 541 (*ic->ic_recv_mgmt)(ic, m, ni, subtype, rssi, rstamp); 542 m_freem(m); 543 return type; 544 545 case IEEE80211_FC0_TYPE_CTL: 546 IEEE80211_NODE_STAT(ni, rx_ctrl); 547 ic->ic_stats.is_rx_ctl++; --- 10 unchanged lines hidden (view full) --- 558 wh, NULL, "bad frame type 0x%x", type); 559 /* should not come here */ 560 break; 561 } 562err: 563 ifp->if_ierrors++; 564out: 565 if (m != NULL) { | 540 bpf_mtap(ic->ic_rawbpf, m); 541 (*ic->ic_recv_mgmt)(ic, m, ni, subtype, rssi, rstamp); 542 m_freem(m); 543 return type; 544 545 case IEEE80211_FC0_TYPE_CTL: 546 IEEE80211_NODE_STAT(ni, rx_ctrl); 547 ic->ic_stats.is_rx_ctl++; --- 10 unchanged lines hidden (view full) --- 558 wh, NULL, "bad frame type 0x%x", type); 559 /* should not come here */ 560 break; 561 } 562err: 563 ifp->if_ierrors++; 564out: 565 if (m != NULL) { |
566 if (ic->ic_rawbpf) | 566 if (bpf_peers_present(ic->ic_rawbpf)) |
567 bpf_mtap(ic->ic_rawbpf, m); 568 m_freem(m); 569 } 570 return type; 571#undef SEQ_LEQ 572} 573 574/* --- 139 unchanged lines hidden (view full) --- 714 if (m == NULL) 715 goto out; /* XXX goto err? */ 716 } 717 (*ifp->if_input)(ifp, m); 718 } 719 return; 720 out: 721 if (m != NULL) { | 567 bpf_mtap(ic->ic_rawbpf, m); 568 m_freem(m); 569 } 570 return type; 571#undef SEQ_LEQ 572} 573 574/* --- 139 unchanged lines hidden (view full) --- 714 if (m == NULL) 715 goto out; /* XXX goto err? */ 716 } 717 (*ifp->if_input)(ifp, m); 718 } 719 return; 720 out: 721 if (m != NULL) { |
722 if (ic->ic_rawbpf) | 722 if (bpf_peers_present(ic->ic_rawbpf)) |
723 bpf_mtap(ic->ic_rawbpf, m); 724 m_freem(m); 725 } 726} 727 728static struct mbuf * 729ieee80211_decap(struct ieee80211com *ic, struct mbuf *m, int hdrlen) 730{ --- 2131 unchanged lines hidden --- | 723 bpf_mtap(ic->ic_rawbpf, m); 724 m_freem(m); 725 } 726} 727 728static struct mbuf * 729ieee80211_decap(struct ieee80211com *ic, struct mbuf *m, int hdrlen) 730{ --- 2131 unchanged lines hidden --- |