Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3e323f3e86196eec18d6959585aa3188d060c43b
Commit:     3e323f3e86196eec18d6959585aa3188d060c43b
Parent:     23de559b8d3537f972f325e7e015c18aa2e4d987
Author:     Peter Korsgaard <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 27 08:48:15 2007 +0200
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Mon Jul 2 08:24:51 2007 -0400

    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 <[EMAIL PROTECTED]>
    Acked-by: David Brownell <[EMAIL PROTECTED]>
    
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 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 5b16d9a..a12f576 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)
        /* don't assume the hardware handles USB_ZERO_PACKET
         * NOTE:  strictly conforming cdc-ether devices should expect
         * 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++;
+               if (skb_tailroom(skb)) {
+                       skb->data[skb->len] = 0;
+                       __skb_put(skb, 1);
+               }
+       }
 
        spin_lock_irqsave (&dev->txq.lock, flags);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to