Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9650
b: refs/heads/master
c: 9bc39be
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Roskin authored and Jeff Garzik committed Oct 5, 2005
1 parent 74613fc commit 1f7fbba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 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: bb77c03cf40fec911c4ce9610b8207bf0050a5fd
refs/heads/master: 9bc39bec87ee3e35897fe27441e979e7c208f624
14 changes: 9 additions & 5 deletions trunk/drivers/net/wireless/orinoco.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,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;

Expand Down Expand Up @@ -557,8 +562,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",
Expand Down

0 comments on commit 1f7fbba

Please sign in to comment.