Skip to content

Commit 3e65efc

Browse files
Forstdavem330
authored andcommitted
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 <[email protected]> Tested-by: Georgi Valkov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2203718 commit 3e65efc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/net/usb/ipheth.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,10 @@ static netdev_tx_t ipheth_tx(struct sk_buff *skb, struct net_device *net)
373373
}
374374

375375
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);
378376

379377
usb_fill_bulk_urb(dev->tx_urb, udev,
380378
usb_sndbulkpipe(udev, dev->bulk_out),
381-
dev->tx_buf, IPHETH_BUF_SIZE,
379+
dev->tx_buf, skb->len,
382380
ipheth_sndbulk_callback,
383381
dev);
384382
dev->tx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;

0 commit comments

Comments
 (0)