mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Breno Leitao <leitao@debian.org>,
	 "David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	 Simon Horman <horms@kernel.org>,
	 Joe Damato <jdamato@fastly.com>
Cc: netdev@vger.kernel.org,  linux-kernel@vger.kernel.org,
	 kernel-team@meta.com,  Breno Leitao <leitao@debian.org>
Subject: Re: [PATCH net] net: netpoll: Initialize UDP checksum field before checksumming
Date: Thu, 26 Jun 2025 13:01:47 -0400	[thread overview]
Message-ID: <685d7cfb42c5b_2e676c29462@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <20250620-netpoll_fix-v1-1-f9f0b82bc059@debian.org>

Breno Leitao wrote:
> commit f1fce08e63fe ("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: f1fce08e63fe ("netpoll: Eliminate redundant assignment")
> Signed-off-by: Breno Leitao <leitao@debian.org>

On second thought: small nit: net/core/netpoll.c patches generally
only have netpoll: as prefix, not net: netpoll:

Also, perhaps just revert the offending patch? Revert, rather than
forward fix.

That said, current approach works too.
> ---
>  net/core/netpoll.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/netpoll.c b/net/core/netpoll.c
> index 4ddb7490df4b8..6ad84d4a2b464 100644
> --- a/net/core/netpoll.c
> +++ b/net/core/netpoll.c
> @@ -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,
> 
> ---
> base-commit: 720d4a1714e78cfdc05d44352868601be9c3de94
> change-id: 20250620-netpoll_fix-8c678facd8d9
> 
> Best regards,
> --  
> Breno Leitao <leitao@debian.org>
> 



      parent reply	other threads:[~2025-06-26 17:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20 18:48 Breno Leitao
2025-06-21 17:55 ` Simon Horman
2025-06-23 23:00 ` patchwork-bot+netdevbpf
2025-06-26 16:59 ` Willem de Bruijn
2025-06-26 17:01 ` Willem de Bruijn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=685d7cfb42c5b_2e676c29462@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®