Commit 3e323f3e authored by Peter Korsgaard's avatar Peter Korsgaard Committed by Jeff Garzik

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: default avatarPeter Korsgaard <jacmet@sunsite.dk>
Acked-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 23de559b
...@@ -953,11 +953,14 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net) ...@@ -953,11 +953,14 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
/* don't assume the hardware handles USB_ZERO_PACKET /* don't assume the hardware handles USB_ZERO_PACKET
* NOTE: strictly conforming cdc-ether devices should expect * NOTE: strictly conforming cdc-ether devices should expect
* the ZLP here, but ignore the one-byte packet. * the ZLP here, but ignore the one-byte packet.
*
* FIXME zero that byte, if it doesn't require a new skb.
*/ */
if ((length % dev->maxpacket) == 0) if ((length % dev->maxpacket) == 0) {
urb->transfer_buffer_length++; urb->transfer_buffer_length++;
if (skb_tailroom(skb)) {
skb->data[skb->len] = 0;
__skb_put(skb, 1);
}
}
spin_lock_irqsave (&dev->txq.lock, flags); spin_lock_irqsave (&dev->txq.lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment