summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-05 08:11:33 +0200
committerJeff Garzik <jgarzik@pobox.com>2005-10-05 08:11:33 +0200
commit0d69ae5fb7eb9ba3b54cf0ba4ef5ae591f31eef7 (patch)
treebe441bfa1e76035c00b66a3b06fea66cfd63d594 /drivers/net/wireless
parentMerge rsync://bughost.org/repos/ieee80211-delta/ (diff)
parent[PATCH] orinoco: Information leakage due to incorrect padding (diff)
downloadlinux-0d69ae5fb7eb9ba3b54cf0ba4ef5ae591f31eef7.tar.xz
linux-0d69ae5fb7eb9ba3b54cf0ba4ef5ae591f31eef7.zip
Merge branch 'master'
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/orinoco.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 78afbc7f08be..da4c5e94a959 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -490,9 +490,14 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
return 0;
}
- /* Length of the packet body */
- /* FIXME: what if the skb is smaller than this? */
- len = max_t(int,skb->len - ETH_HLEN, ETH_ZLEN - ETH_HLEN);
+ /* Check packet length, pad short packets, round up odd length */
+ len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN);
+ if (skb->len < len) {
+ skb = skb_padto(skb, len);
+ if (skb == NULL)
+ goto fail;
+ }
+ len -= ETH_HLEN;
eh = (struct ethhdr *)skb->data;
@@ -544,8 +549,7 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
p = skb->data;
}
- /* Round up for odd length packets */
- err = hermes_bap_pwrite(hw, USER_BAP, p, ALIGN(data_len, 2),
+ err = hermes_bap_pwrite(hw, USER_BAP, p, data_len,
txfid, data_off);
if (err) {
printk(KERN_ERR "%s: Error %d writing packet to BAP\n",