mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
net: netpoll: Initialize UDP checksum field before checksumming
commitf1fce08e63
("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:f1fce08e63
("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>
This commit is contained in:
parent
95b6759a81
commit
f599020702
1 changed files with 1 additions and 1 deletions
|
@ -432,6 +432,7 @@ int netpoll_send_udp(struct netpoll *np, const char *msg, int len)
|
|||
udph->dest = htons(np->remote_port);
|
||||
udph->len = htons(udp_len);
|
||||
|
||||
udph->check = 0;
|
||||
if (np->ipv6) {
|
||||
udph->check = csum_ipv6_magic(&np->local_ip.in6,
|
||||
&np->remote_ip.in6,
|
||||
|
@ -460,7 +461,6 @@ int netpoll_send_udp(struct netpoll *np, const char *msg, int len)
|
|||
skb_reset_mac_header(skb);
|
||||
skb->protocol = eth->h_proto = htons(ETH_P_IPV6);
|
||||
} else {
|
||||
udph->check = 0;
|
||||
udph->check = csum_tcpudp_magic(np->local_ip.ip,
|
||||
np->remote_ip.ip,
|
||||
udp_len, IPPROTO_UDP,
|
||||
|
|
Loading…
Add table
Reference in a new issue