Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10354
b: refs/heads/master
c: f0f15ab
h: refs/heads/master
v: v3
  • Loading branch information
Hong Liu authored and James Ketrenos committed Oct 20, 2005
1 parent b69e331 commit 8bc9e5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5b74eda78db410b979b7d450221c971fdebf5d29
refs/heads/master: f0f15ab5542f73d07e35eeee713df289599427b2
11 changes: 7 additions & 4 deletions trunk/net/ieee80211/ieee80211_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,14 @@ static inline int ieee80211_encrypt_fragment(struct ieee80211_device *ieee,
struct ieee80211_crypt_data *crypt = ieee->crypt[ieee->tx_keyidx];
int res;

if (crypt == NULL)
return -1;

/* To encrypt, frame format is:
* IV (4 bytes), clear payload (including SNAP), ICV (4 bytes) */
atomic_inc(&crypt->refcnt);
res = 0;
if (crypt->ops->encrypt_mpdu)
if (crypt->ops && crypt->ops->encrypt_mpdu)
res = crypt->ops->encrypt_mpdu(frag, hdr_len, crypt->priv);

atomic_dec(&crypt->refcnt);
Expand Down Expand Up @@ -264,9 +267,9 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) &&
ieee->sec.encrypt;

host_encrypt = ieee->host_encrypt && encrypt;
host_encrypt_msdu = ieee->host_encrypt_msdu && encrypt;
host_build_iv = ieee->host_build_iv && encrypt;
host_encrypt = ieee->host_encrypt && encrypt && crypt;
host_encrypt_msdu = ieee->host_encrypt_msdu && encrypt && crypt;
host_build_iv = ieee->host_build_iv && encrypt && crypt;

if (!encrypt && ieee->ieee802_1x &&
ieee->drop_unencrypted && ether_type != ETH_P_PAE) {
Expand Down

0 comments on commit 8bc9e5b

Please sign in to comment.