diff options
author | Peter Korsgaard <jacmet@sunsite.dk> | 2007-06-27 02:48:15 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-02 08:24:51 -0400 |
commit | 3e323f3e86196eec18d6959585aa3188d060c43b (patch) | |
tree | ecfd354c67ee0d44c811d696fe7371f7502e1b11 /drivers | |
parent | 23de559b8d3537f972f325e7e015c18aa2e4d987 (diff) |
usbnet: Zero padding byte if there is tail room in skb
Usbnet adds a padding byte if a 0 byte USB packet would be sent. Zero
padding byte if there is tail room in skb.
Signed-of-by: Peter Korsgaard <jacmet@sunsite.dk>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/usb/usbnet.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 5b16d9a1269a..a12f576391cf 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -953,11 +953,14 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net) | |||
953 | /* don't assume the hardware handles USB_ZERO_PACKET | 953 | /* don't assume the hardware handles USB_ZERO_PACKET |
954 | * NOTE: strictly conforming cdc-ether devices should expect | 954 | * NOTE: strictly conforming cdc-ether devices should expect |
955 | * the ZLP here, but ignore the one-byte packet. | 955 | * the ZLP here, but ignore the one-byte packet. |
956 | * | ||
957 | * FIXME zero that byte, if it doesn't require a new skb. | ||
958 | */ | 956 | */ |
959 | if ((length % dev->maxpacket) == 0) | 957 | if ((length % dev->maxpacket) == 0) { |
960 | urb->transfer_buffer_length++; | 958 | urb->transfer_buffer_length++; |
959 | if (skb_tailroom(skb)) { | ||
960 | skb->data[skb->len] = 0; | ||
961 | __skb_put(skb, 1); | ||
962 | } | ||
963 | } | ||
961 | 964 | ||
962 | spin_lock_irqsave (&dev->txq.lock, flags); | 965 | spin_lock_irqsave (&dev->txq.lock, flags); |
963 | 966 | ||