Skip to content

Commit f599020

Browse files
leitaokuba-moo
authored andcommitted
net: netpoll: Initialize UDP checksum field before checksumming
commit f1fce08 ("netpoll: Eliminate redundant assignment") removed the initialization of the UDP checksum, which was wrong and broke netpoll IPv6 transmission due to bad checksumming. udph->check needs to be set before calling csum_ipv6_magic(). Fixes: f1fce08 ("netpoll: Eliminate redundant assignment") Signed-off-by: Breno Leitao <leitao@debian.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20250620-netpoll_fix-v1-1-f9f0b82bc059@debian.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 95b6759 commit f599020

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/core/netpoll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ int netpoll_send_udp(struct netpoll *np, const char *msg, int len)
432432
udph->dest = htons(np->remote_port);
433433
udph->len = htons(udp_len);
434434

435+
udph->check = 0;
435436
if (np->ipv6) {
436437
udph->check = csum_ipv6_magic(&np->local_ip.in6,
437438
&np->remote_ip.in6,
@@ -460,7 +461,6 @@ int netpoll_send_udp(struct netpoll *np, const char *msg, int len)
460461
skb_reset_mac_header(skb);
461462
skb->protocol = eth->h_proto = htons(ETH_P_IPV6);
462463
} else {
463-
udph->check = 0;
464464
udph->check = csum_tcpudp_magic(np->local_ip.ip,
465465
np->remote_ip.ip,
466466
udp_len, IPPROTO_UDP,

0 commit comments

Comments
 (0)