Changeset View
Changeset View
Standalone View
Standalone View
sys/net80211/ieee80211_adhoc.c
Show First 20 Lines • Show All 565 Lines • ▼ Show 20 Lines | if (m == NULL) { | ||||
subtype == IEEE80211_FC0_SUBTYPE_QOS_NULL) | subtype == IEEE80211_FC0_SUBTYPE_QOS_NULL) | ||||
goto out; | goto out; | ||||
IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, | IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, | ||||
ni->ni_macaddr, "data", "%s", "decap error"); | ni->ni_macaddr, "data", "%s", "decap error"); | ||||
vap->iv_stats.is_rx_decap++; | vap->iv_stats.is_rx_decap++; | ||||
IEEE80211_NODE_STAT(ni, rx_decap); | IEEE80211_NODE_STAT(ni, rx_decap); | ||||
goto err; | goto err; | ||||
} | } | ||||
if (!(qos & IEEE80211_QOS_AMSDU)) | |||||
eh = mtod(m, struct ether_header *); | eh = mtod(m, struct ether_header *); | ||||
else | |||||
eh = NULL; | |||||
if (!ieee80211_node_is_authorized(ni)) { | if (!ieee80211_node_is_authorized(ni)) { | ||||
/* | /* | ||||
* Deny any non-PAE frames received prior to | * Deny any non-PAE frames received prior to | ||||
* authorization. For open/shared-key | * authorization. For open/shared-key | ||||
* authentication the port is mark authorized | * authentication the port is mark authorized | ||||
* after authentication completes. For 802.1x | * after authentication completes. For 802.1x | ||||
* the port is not marked authorized by the | * the port is not marked authorized by the | ||||
* authenticator until the handshake has completed. | * authenticator until the handshake has completed. | ||||
*/ | */ | ||||
if (eh->ether_type != htons(ETHERTYPE_PAE)) { | if (eh == NULL || | ||||
eh->ether_type != htons(ETHERTYPE_PAE)) { | |||||
IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, | IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, | ||||
eh->ether_shost, "data", | ni->ni_macaddr, "data", "unauthorized or " | ||||
emaste: I might take advantage of the recent >80 col style allowance to keep at least the main part of… | |||||
bzAuthorUnsubmitted Done Inline ActionsI was pondering this but I added func, LINE information to all of them in cb5c07649aa005abb1e847c2cd5f816d762efb93 so I think formatting/wrapping won't matter so much anymore on any of them. bz: I was pondering this but I added __func__, __LINE__ information to all of them in… | |||||
"unauthorized port: ether type 0x%x len %u", | "unknown port: ether type 0x%x len %u", | ||||
eh->ether_type, m->m_pkthdr.len); | eh == NULL ? -1 : eh->ether_type, | ||||
m->m_pkthdr.len); | |||||
vap->iv_stats.is_rx_unauth++; | vap->iv_stats.is_rx_unauth++; | ||||
IEEE80211_NODE_STAT(ni, rx_unauth); | IEEE80211_NODE_STAT(ni, rx_unauth); | ||||
goto err; | goto err; | ||||
} | } | ||||
} else { | } else { | ||||
/* | /* | ||||
* When denying unencrypted frames, discard | * When denying unencrypted frames, discard | ||||
* any non-PAE frames received without encryption. | * any non-PAE frames received without encryption. | ||||
*/ | */ | ||||
if ((vap->iv_flags & IEEE80211_F_DROPUNENC) && | if ((vap->iv_flags & IEEE80211_F_DROPUNENC) && | ||||
((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) && | ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) && | ||||
(is_hw_decrypted == 0) && | (is_hw_decrypted == 0) && | ||||
eh->ether_type != htons(ETHERTYPE_PAE)) { | (eh == NULL || | ||||
eh->ether_type != htons(ETHERTYPE_PAE))) { | |||||
/* | /* | ||||
* Drop unencrypted frames. | * Drop unencrypted frames. | ||||
*/ | */ | ||||
vap->iv_stats.is_rx_unencrypted++; | vap->iv_stats.is_rx_unencrypted++; | ||||
IEEE80211_NODE_STAT(ni, rx_unencrypted); | IEEE80211_NODE_STAT(ni, rx_unencrypted); | ||||
goto out; | goto out; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 444 Lines • Show Last 20 Lines |
I might take advantage of the recent >80 col style allowance to keep at least the main part of the message together (or, just break before "ether type" perhaps)
I could see someone upon encountering this message doing a grep for unauthorized or unknown.
And similar for other messages.