View | Details | Raw Unified | Return to bug 256120
Collapse All | Expand All

(-)b/sys/net80211/ieee80211_adhoc.c (-6 / +10 lines)
Lines 571-577 adhoc_input(struct ieee80211_node *ni, struct mbuf *m, Link Here
571
			IEEE80211_NODE_STAT(ni, rx_decap);
571
			IEEE80211_NODE_STAT(ni, rx_decap);
572
			goto err;
572
			goto err;
573
		}
573
		}
574
		eh = mtod(m, struct ether_header *);
574
		if (!(qos & IEEE80211_QOS_AMSDU))
575
			eh = mtod(m, struct ether_header *);
575
		if (!ieee80211_node_is_authorized(ni)) {
576
		if (!ieee80211_node_is_authorized(ni)) {
576
			/*
577
			/*
577
			 * Deny any non-PAE frames received prior to
578
			 * Deny any non-PAE frames received prior to
Lines 581-591 adhoc_input(struct ieee80211_node *ni, struct mbuf *m, Link Here
581
			 * the port is not marked authorized by the
582
			 * the port is not marked authorized by the
582
			 * authenticator until the handshake has completed.
583
			 * authenticator until the handshake has completed.
583
			 */
584
			 */
584
			if (eh->ether_type != htons(ETHERTYPE_PAE)) {
585
			if (eh == NULL ||
586
			    eh->ether_type != htons(ETHERTYPE_PAE)) {
585
				IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
587
				IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
586
				    eh->ether_shost, "data",
588
				    ni->ni_macaddr, "data",
587
				    "unauthorized port: ether type 0x%x len %u",
589
				    "unauthorized or unknown port: ether type 0x%x len %u",
588
				    eh->ether_type, m->m_pkthdr.len);
590
				    eh == NULL ? -1 : eh->ether_type,
591
				    m->m_pkthdr.len);
589
				vap->iv_stats.is_rx_unauth++;
592
				vap->iv_stats.is_rx_unauth++;
590
				IEEE80211_NODE_STAT(ni, rx_unauth);
593
				IEEE80211_NODE_STAT(ni, rx_unauth);
591
				goto err;
594
				goto err;
Lines 598-604 adhoc_input(struct ieee80211_node *ni, struct mbuf *m, Link Here
598
			if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
601
			if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
599
			    ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) &&
602
			    ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) &&
600
			    (is_hw_decrypted == 0) &&
603
			    (is_hw_decrypted == 0) &&
601
			    eh->ether_type != htons(ETHERTYPE_PAE)) {
604
			    (eh == NULL ||
605
			     eh->ether_type != htons(ETHERTYPE_PAE))) {
602
				/*
606
				/*
603
				 * Drop unencrypted frames.
607
				 * Drop unencrypted frames.
604
				 */
608
				 */
(-)b/sys/net80211/ieee80211_hostap.c (-6 / +10 lines)
Lines 757-763 hostap_input(struct ieee80211_node *ni, struct mbuf *m, Link Here
757
			IEEE80211_NODE_STAT(ni, rx_decap);
757
			IEEE80211_NODE_STAT(ni, rx_decap);
758
			goto err;
758
			goto err;
759
		}
759
		}
760
		eh = mtod(m, struct ether_header *);
760
		if (!(qos & IEEE80211_QOS_AMSDU))
761
			eh = mtod(m, struct ether_header *);
761
		if (!ieee80211_node_is_authorized(ni)) {
762
		if (!ieee80211_node_is_authorized(ni)) {
762
			/*
763
			/*
763
			 * Deny any non-PAE frames received prior to
764
			 * Deny any non-PAE frames received prior to
Lines 767-777 hostap_input(struct ieee80211_node *ni, struct mbuf *m, Link Here
767
			 * the port is not marked authorized by the
768
			 * the port is not marked authorized by the
768
			 * authenticator until the handshake has completed.
769
			 * authenticator until the handshake has completed.
769
			 */
770
			 */
770
			if (eh->ether_type != htons(ETHERTYPE_PAE)) {
771
			if (eh == NULL ||
772
			    eh->ether_type != htons(ETHERTYPE_PAE)) {
771
				IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
773
				IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
772
				    eh->ether_shost, "data",
774
				    ni->ni_macaddr, "data",
773
				    "unauthorized port: ether type 0x%x len %u",
775
				    "unauthorized or unknown port: ether type 0x%x len %u",
774
				    eh->ether_type, m->m_pkthdr.len);
776
				    eh == NULL ? -1 : eh->ether_type,
777
				    m->m_pkthdr.len);
775
				vap->iv_stats.is_rx_unauth++;
778
				vap->iv_stats.is_rx_unauth++;
776
				IEEE80211_NODE_STAT(ni, rx_unauth);
779
				IEEE80211_NODE_STAT(ni, rx_unauth);
777
				goto err;
780
				goto err;
Lines 784-790 hostap_input(struct ieee80211_node *ni, struct mbuf *m, Link Here
784
			if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
787
			if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
785
			    ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) &&
788
			    ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) &&
786
			    (is_hw_decrypted == 0) &&
789
			    (is_hw_decrypted == 0) &&
787
			    eh->ether_type != htons(ETHERTYPE_PAE)) {
790
			    (eh == NULL ||
791
			     eh->ether_type != htons(ETHERTYPE_PAE))) {
788
				/*
792
				/*
789
				 * Drop unencrypted frames.
793
				 * Drop unencrypted frames.
790
				 */
794
				 */
(-)b/sys/net80211/ieee80211_sta.c (-6 / +10 lines)
Lines 840-846 sta_input(struct ieee80211_node *ni, struct mbuf *m, Link Here
840
			IEEE80211_NODE_STAT(ni, rx_decap);
840
			IEEE80211_NODE_STAT(ni, rx_decap);
841
			goto err;
841
			goto err;
842
		}
842
		}
843
		eh = mtod(m, struct ether_header *);
843
		if (!(qos & IEEE80211_QOS_AMSDU))
844
			eh = mtod(m, struct ether_header *);
844
		if (!ieee80211_node_is_authorized(ni)) {
845
		if (!ieee80211_node_is_authorized(ni)) {
845
			/*
846
			/*
846
			 * Deny any non-PAE frames received prior to
847
			 * Deny any non-PAE frames received prior to
Lines 850-860 sta_input(struct ieee80211_node *ni, struct mbuf *m, Link Here
850
			 * the port is not marked authorized by the
851
			 * the port is not marked authorized by the
851
			 * authenticator until the handshake has completed.
852
			 * authenticator until the handshake has completed.
852
			 */
853
			 */
853
			if (eh->ether_type != htons(ETHERTYPE_PAE)) {
854
			if (eh == NULL ||
855
			    eh->ether_type != htons(ETHERTYPE_PAE)) {
854
				IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
856
				IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
855
				    eh->ether_shost, "data",
857
				    ni->ni_macaddr, "data",
856
				    "unauthorized port: ether type 0x%x len %u",
858
				    "unauthorized or unknown port: ether type 0x%x len %u",
857
				    eh->ether_type, m->m_pkthdr.len);
859
				    eh == NULL ? -1 : eh->ether_type,
860
				    m->m_pkthdr.len);
858
				vap->iv_stats.is_rx_unauth++;
861
				vap->iv_stats.is_rx_unauth++;
859
				IEEE80211_NODE_STAT(ni, rx_unauth);
862
				IEEE80211_NODE_STAT(ni, rx_unauth);
860
				goto err;
863
				goto err;
Lines 867-873 sta_input(struct ieee80211_node *ni, struct mbuf *m, Link Here
867
			if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
870
			if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
868
			    ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) &&
871
			    ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) &&
869
			    (is_hw_decrypted == 0) &&
872
			    (is_hw_decrypted == 0) &&
870
			    eh->ether_type != htons(ETHERTYPE_PAE)) {
873
			    (eh == NULL ||
874
			     eh->ether_type != htons(ETHERTYPE_PAE))) {
871
				/*
875
				/*
872
				 * Drop unencrypted frames.
876
				 * Drop unencrypted frames.
873
				 */
877
				 */
(-)b/sys/net80211/ieee80211_wds.c (-7 / +10 lines)
Lines 634-640 wds_input(struct ieee80211_node *ni, struct mbuf *m, Link Here
634
			IEEE80211_NODE_STAT(ni, rx_decap);
634
			IEEE80211_NODE_STAT(ni, rx_decap);
635
			goto err;
635
			goto err;
636
		}
636
		}
637
		eh = mtod(m, struct ether_header *);
637
		if (!(qos & IEEE80211_QOS_AMSDU))
638
			eh = mtod(m, struct ether_header *);
638
		if (!ieee80211_node_is_authorized(ni)) {
639
		if (!ieee80211_node_is_authorized(ni)) {
639
			/*
640
			/*
640
			 * Deny any non-PAE frames received prior to
641
			 * Deny any non-PAE frames received prior to
Lines 644-654 wds_input(struct ieee80211_node *ni, struct mbuf *m, Link Here
644
			 * the port is not marked authorized by the
645
			 * the port is not marked authorized by the
645
			 * authenticator until the handshake has completed.
646
			 * authenticator until the handshake has completed.
646
			 */
647
			 */
647
			if (eh->ether_type != htons(ETHERTYPE_PAE)) {
648
			if (eh == NULL ||
649
			    eh->ether_type != htons(ETHERTYPE_PAE)) {
648
				IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
650
				IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
649
				    eh->ether_shost, "data",
651
				    ni->ni_macaddr, "data",
650
				    "unauthorized port: ether type 0x%x len %u",
652
				    "unauthorized or unknown port: ether type 0x%x len %u",
651
				    eh->ether_type, m->m_pkthdr.len);
653
				    eh == NULL ? -1 : eh->ether_type,
654
				    m->m_pkthdr.len);
652
				vap->iv_stats.is_rx_unauth++;
655
				vap->iv_stats.is_rx_unauth++;
653
				IEEE80211_NODE_STAT(ni, rx_unauth);
656
				IEEE80211_NODE_STAT(ni, rx_unauth);
654
				goto err;
657
				goto err;
Lines 661-667 wds_input(struct ieee80211_node *ni, struct mbuf *m, Link Here
661
			if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
664
			if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
662
			    ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) &&
665
			    ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) &&
663
			    (is_hw_decrypted == 0) &&
666
			    (is_hw_decrypted == 0) &&
664
			    eh->ether_type != htons(ETHERTYPE_PAE)) {
667
			    (eh == NULL ||
668
			     eh->ether_type != htons(ETHERTYPE_PAE))) {
665
				/*
669
				/*
666
				 * Drop unencrypted frames.
670
				 * Drop unencrypted frames.
667
				 */
671
				 */
668
- 

Return to bug 256120