diff options
| author | Greg Kroah-Hartman <[email protected]> | 2025-04-28 08:32:58 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2025-04-28 08:32:58 +0000 |
| commit | 615dca38c2eae55aff80050275931c87a812b48c (patch) | |
| tree | 8674a3a3f66a39bf7c7f2ab733a757e624bd99ec /net/core/selftests.c | |
| parent | usb: gadget: u_serial: Implement remote wakeup capability (diff) | |
| parent | Linux 6.15-rc4 (diff) | |
| download | kernel-615dca38c2eae55aff80050275931c87a812b48c.tar.gz kernel-615dca38c2eae55aff80050275931c87a812b48c.zip | |
Merge 6.15-rc4 into usb-next
We need the USB fixes in here as well, and this resolves the following
merge conflicts that were reported in linux-next:
drivers/usb/chipidea/ci_hdrc_imx.c
drivers/usb/host/xhci.h
Reported-by: Stephen Rothwell <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'net/core/selftests.c')
| -rw-r--r-- | net/core/selftests.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/net/core/selftests.c b/net/core/selftests.c index e99ae983fca9..35f807ea9952 100644 --- a/net/core/selftests.c +++ b/net/core/selftests.c @@ -100,10 +100,10 @@ static struct sk_buff *net_test_get_skb(struct net_device *ndev, ehdr->h_proto = htons(ETH_P_IP); if (attr->tcp) { + memset(thdr, 0, sizeof(*thdr)); thdr->source = htons(attr->sport); thdr->dest = htons(attr->dport); thdr->doff = sizeof(struct tcphdr) / 4; - thdr->check = 0; } else { uhdr->source = htons(attr->sport); uhdr->dest = htons(attr->dport); @@ -144,10 +144,18 @@ static struct sk_buff *net_test_get_skb(struct net_device *ndev, attr->id = net_test_next_id; shdr->id = net_test_next_id++; - if (attr->size) - skb_put(skb, attr->size); - if (attr->max_size && attr->max_size > skb->len) - skb_put(skb, attr->max_size - skb->len); + if (attr->size) { + void *payload = skb_put(skb, attr->size); + + memset(payload, 0, attr->size); + } + + if (attr->max_size && attr->max_size > skb->len) { + size_t pad_len = attr->max_size - skb->len; + void *pad = skb_put(skb, pad_len); + + memset(pad, 0, pad_len); + } skb->csum = 0; skb->ip_summed = CHECKSUM_PARTIAL; |
