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 <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 95b6759 commit f599020

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)