From nobody Sun May 10 17:53:54 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D096C433EF for ; Fri, 29 Apr 2022 20:05:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380549AbiD2UI4 (ORCPT ); Fri, 29 Apr 2022 16:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379474AbiD2UIu (ORCPT ); Fri, 29 Apr 2022 16:08:50 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 639226A034 for ; Fri, 29 Apr 2022 13:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651262728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xh8dSPuYVd16pGU1eOSrw4RK/14MRTLIpBGTzg2s4yA=; b=Fg3AElSdPM/VIiWvP9qm46LTdqU06KEAtSxlY1D3NR4nmlXzsix0Xj8F1/Ryxzi4gdAFZc YtCZkLLFxWoVYyQdpsaQa8G92HJP8a4PL6G8ed5sfJmL/yE5U4IlCaXwbfLoDIxoPp045e riIAd1dcALiuRskqbn/DsQD1DAas/SA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-463-esZLPebUMWGXCyP_e6a1-g-1; Fri, 29 Apr 2022 16:05:24 -0400 X-MC-Unique: esZLPebUMWGXCyP_e6a1-g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 032C7281182B; Fri, 29 Apr 2022 20:05:24 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB3BCC28100; Fri, 29 Apr 2022 20:05:22 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH net] rxrpc: Enable IPv6 checksums on transport socket From: David Howells To: netdev@vger.kernel.org Cc: Marc Dionne , Xin Long , Marc Dionne , Vadim Fedorenko , "David S. Miller" , linux-afs@lists.infradead.org, dhowells@redhat.com, linux-kernel@vger.kernel.org Date: Fri, 29 Apr 2022 21:05:16 +0100 Message-ID: <165126271697.1384698.4579591150130001289.stgit@warthog.procyon.org.uk> User-Agent: StGit/1.4 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org AF_RXRPC doesn't currently enable IPv6 UDP Tx checksums on the transport socket it opens and the checksums in the packets it generates end up 0. It probably should also enable IPv6 UDP Rx checksums and IPv4 UDP checksums. The latter only seem to be applied if the socket family is AF_INET and don't seem to apply if it's AF_INET6. IPv4 packets from an IPv6 socket seem to have checksums anyway. What seems to have happened is that the inet_inv_convert_csum() call didn't get converted to the appropriate udp_port_cfg parameters - and udp_sock_create() disables checksums unless explicitly told not too. Fix this by enabling the three udp_port_cfg checksum options. Fixes: 1a9b86c9fd95 ("rxrpc: use udp tunnel APIs instead of open code in rx= rpc_open_socket") Reported-by: Marc Dionne Signed-off-by: David Howells Reviewed-by: Xin Long Reviewed-by: Marc Dionne cc: Vadim Fedorenko cc: David S. Miller cc: linux-afs@lists.infradead.org --- net/rxrpc/local_object.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c index a4111408ffd0..6a1611b0e303 100644 --- a/net/rxrpc/local_object.c +++ b/net/rxrpc/local_object.c @@ -117,6 +117,7 @@ static int rxrpc_open_socket(struct rxrpc_local *local,= struct net *net) local, srx->transport_type, srx->transport.family); =20 udp_conf.family =3D srx->transport.family; + udp_conf.use_udp_checksums =3D true; if (udp_conf.family =3D=3D AF_INET) { udp_conf.local_ip =3D srx->transport.sin.sin_addr; udp_conf.local_udp_port =3D srx->transport.sin.sin_port; @@ -124,6 +125,8 @@ static int rxrpc_open_socket(struct rxrpc_local *local,= struct net *net) } else { udp_conf.local_ip6 =3D srx->transport.sin6.sin6_addr; udp_conf.local_udp_port =3D srx->transport.sin6.sin6_port; + udp_conf.use_udp6_tx_checksums =3D true; + udp_conf.use_udp6_rx_checksums =3D true; #endif } ret =3D udp_sock_create(net, &udp_conf, &local->socket);