Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usbnet: ipheth: transmit URBs without trailing padding

The behaviour of the official iOS tethering driver on macOS is to not
transmit any trailing padding at the end of URBs. This is applicable
to both NCM and legacy modes, including older devices.

Adapt the driver to not include trailing padding in TX URBs, matching
the behaviour of the official macOS driver.

Signed-off-by: Foster Snowhill <forst@pen.gy>
Tested-by: Georgi Valkov <gvalkov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Foster Snowhill and committed by
David S. Miller
3e65efcc 2203718c

+1 -3
+1 -3
drivers/net/usb/ipheth.c
··· 373 373 } 374 374 375 375 memcpy(dev->tx_buf, skb->data, skb->len); 376 - if (skb->len < IPHETH_BUF_SIZE) 377 - memset(dev->tx_buf + skb->len, 0, IPHETH_BUF_SIZE - skb->len); 378 376 379 377 usb_fill_bulk_urb(dev->tx_urb, udev, 380 378 usb_sndbulkpipe(udev, dev->bulk_out), 381 - dev->tx_buf, IPHETH_BUF_SIZE, 379 + dev->tx_buf, skb->len, 382 380 ipheth_sndbulk_callback, 383 381 dev); 384 382 dev->tx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;