diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2007-12-29 05:01:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:08:48 -0500 |
commit | d9e94d5647ee6700773d81514a8ccb7dc6342fb4 (patch) | |
tree | 826132c6f2da28b253d9f94c3da8075bffa19640 /net/ieee80211/ieee80211_tx.c | |
parent | c414e84b2200ca8a7e7ae565cad200e5c02e02ec (diff) |
ieee80211: fix misannotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/ieee80211/ieee80211_tx.c')
-rw-r--r-- | net/ieee80211/ieee80211_tx.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c index 6d06f1385e28..d8b02603cbe5 100644 --- a/net/ieee80211/ieee80211_tx.c +++ b/net/ieee80211/ieee80211_tx.c | |||
@@ -126,7 +126,7 @@ payload of each frame is reduced to 492 bytes. | |||
126 | static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 }; | 126 | static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 }; |
127 | static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 }; | 127 | static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 }; |
128 | 128 | ||
129 | static int ieee80211_copy_snap(u8 * data, u16 h_proto) | 129 | static int ieee80211_copy_snap(u8 * data, __be16 h_proto) |
130 | { | 130 | { |
131 | struct ieee80211_snap_hdr *snap; | 131 | struct ieee80211_snap_hdr *snap; |
132 | u8 *oui; | 132 | u8 *oui; |
@@ -136,7 +136,7 @@ static int ieee80211_copy_snap(u8 * data, u16 h_proto) | |||
136 | snap->ssap = 0xaa; | 136 | snap->ssap = 0xaa; |
137 | snap->ctrl = 0x03; | 137 | snap->ctrl = 0x03; |
138 | 138 | ||
139 | if (h_proto == 0x8137 || h_proto == 0x80f3) | 139 | if (h_proto == htons(ETH_P_AARP) || h_proto == htons(ETH_P_IPX)) |
140 | oui = P802_1H_OUI; | 140 | oui = P802_1H_OUI; |
141 | else | 141 | else |
142 | oui = RFC1042_OUI; | 142 | oui = RFC1042_OUI; |
@@ -144,7 +144,6 @@ static int ieee80211_copy_snap(u8 * data, u16 h_proto) | |||
144 | snap->oui[1] = oui[1]; | 144 | snap->oui[1] = oui[1]; |
145 | snap->oui[2] = oui[2]; | 145 | snap->oui[2] = oui[2]; |
146 | 146 | ||
147 | h_proto = htons(h_proto); | ||
148 | memcpy(data + SNAP_SIZE, &h_proto, sizeof(u16)); | 147 | memcpy(data + SNAP_SIZE, &h_proto, sizeof(u16)); |
149 | 148 | ||
150 | return SNAP_SIZE + sizeof(u16); | 149 | return SNAP_SIZE + sizeof(u16); |
@@ -261,7 +260,8 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
261 | rts_required; | 260 | rts_required; |
262 | unsigned long flags; | 261 | unsigned long flags; |
263 | struct net_device_stats *stats = &ieee->stats; | 262 | struct net_device_stats *stats = &ieee->stats; |
264 | int ether_type, encrypt, host_encrypt, host_encrypt_msdu, host_build_iv; | 263 | int encrypt, host_encrypt, host_encrypt_msdu, host_build_iv; |
264 | __be16 ether_type; | ||
265 | int bytes, fc, hdr_len; | 265 | int bytes, fc, hdr_len; |
266 | struct sk_buff *skb_frag; | 266 | struct sk_buff *skb_frag; |
267 | struct ieee80211_hdr_3addrqos header = {/* Ensure zero initialized */ | 267 | struct ieee80211_hdr_3addrqos header = {/* Ensure zero initialized */ |
@@ -292,11 +292,11 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
292 | goto success; | 292 | goto success; |
293 | } | 293 | } |
294 | 294 | ||
295 | ether_type = ntohs(((struct ethhdr *)skb->data)->h_proto); | 295 | ether_type = ((struct ethhdr *)skb->data)->h_proto; |
296 | 296 | ||
297 | crypt = ieee->crypt[ieee->tx_keyidx]; | 297 | crypt = ieee->crypt[ieee->tx_keyidx]; |
298 | 298 | ||
299 | encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) && | 299 | encrypt = !(ether_type == htons(ETH_P_PAE) && ieee->ieee802_1x) && |
300 | ieee->sec.encrypt; | 300 | ieee->sec.encrypt; |
301 | 301 | ||
302 | host_encrypt = ieee->host_encrypt && encrypt && crypt; | 302 | host_encrypt = ieee->host_encrypt && encrypt && crypt; |
@@ -304,7 +304,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
304 | host_build_iv = ieee->host_build_iv && encrypt && crypt; | 304 | host_build_iv = ieee->host_build_iv && encrypt && crypt; |
305 | 305 | ||
306 | if (!encrypt && ieee->ieee802_1x && | 306 | if (!encrypt && ieee->ieee802_1x && |
307 | ieee->drop_unencrypted && ether_type != ETH_P_PAE) { | 307 | ieee->drop_unencrypted && ether_type != htons(ETH_P_PAE)) { |
308 | stats->tx_dropped++; | 308 | stats->tx_dropped++; |
309 | goto success; | 309 | goto success; |
310 | } | 310 | } |