diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2007-12-18 19:31:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:59:46 -0500 |
commit | 678f5f7117d5780d3a51b201c9f44b7bf90f6a76 (patch) | |
tree | ddf555061ec729e3e14eabc506d0c3b8f32f25b8 /net/mac80211/tx.c | |
parent | ce3edf6d0b979fa4d5da7204fd8c6f77f2b8622a (diff) |
mac80211: clean up eapol handling in TX path
The previous patch left only one user of the ieee80211_is_eapol()
function and that user can be eliminated easily by introducing
a new "frame is EAPOL" flag to handle the frame specially (we
already have this information) instead of doing the (expensive)
ieee80211_is_eapol() all the time.
Also, allow unencrypted frames to be sent when they are injected.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r-- | net/mac80211/tx.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 6dbd91842881..e177a8dc23b9 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -437,7 +437,8 @@ ieee80211_tx_h_select_key(struct ieee80211_txrx_data *tx) | |||
437 | else if ((key = rcu_dereference(tx->sdata->default_key))) | 437 | else if ((key = rcu_dereference(tx->sdata->default_key))) |
438 | tx->key = key; | 438 | tx->key = key; |
439 | else if (tx->sdata->drop_unencrypted && | 439 | else if (tx->sdata->drop_unencrypted && |
440 | !ieee80211_is_eapol(tx->skb, ieee80211_get_hdrlen(fc))) { | 440 | !(tx->u.tx.control->flags & IEEE80211_TXCTL_EAPOL_FRAME) && |
441 | !(tx->flags & IEEE80211_TXRXD_TX_INJECTED)) { | ||
441 | I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted); | 442 | I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted); |
442 | return TXRX_DROP; | 443 | return TXRX_DROP; |
443 | } else { | 444 | } else { |
@@ -1241,6 +1242,8 @@ int ieee80211_master_start_xmit(struct sk_buff *skb, | |||
1241 | control.flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT; | 1242 | control.flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT; |
1242 | if (pkt_data->flags & IEEE80211_TXPD_REQUEUE) | 1243 | if (pkt_data->flags & IEEE80211_TXPD_REQUEUE) |
1243 | control.flags |= IEEE80211_TXCTL_REQUEUE; | 1244 | control.flags |= IEEE80211_TXCTL_REQUEUE; |
1245 | if (pkt_data->flags & IEEE80211_TXPD_EAPOL_FRAME) | ||
1246 | control.flags |= IEEE80211_TXCTL_EAPOL_FRAME; | ||
1244 | control.queue = pkt_data->queue; | 1247 | control.queue = pkt_data->queue; |
1245 | 1248 | ||
1246 | ret = ieee80211_tx(odev, skb, &control); | 1249 | ret = ieee80211_tx(odev, skb, &control); |
@@ -1514,6 +1517,8 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1514 | pkt_data = (struct ieee80211_tx_packet_data *)skb->cb; | 1517 | pkt_data = (struct ieee80211_tx_packet_data *)skb->cb; |
1515 | memset(pkt_data, 0, sizeof(struct ieee80211_tx_packet_data)); | 1518 | memset(pkt_data, 0, sizeof(struct ieee80211_tx_packet_data)); |
1516 | pkt_data->ifindex = dev->ifindex; | 1519 | pkt_data->ifindex = dev->ifindex; |
1520 | if (ethertype == ETH_P_PAE) | ||
1521 | pkt_data->flags |= IEEE80211_TXPD_EAPOL_FRAME; | ||
1517 | 1522 | ||
1518 | skb->dev = local->mdev; | 1523 | skb->dev = local->mdev; |
1519 | dev->stats.tx_packets++; | 1524 | dev->stats.tx_packets++; |