Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4372924imw; Tue, 19 Jul 2022 05:33:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tKweI6Uqo1wJH/uR4hMFaVHL88vToMDSt5+3p0h+y8MM9aalM5b18e/ix31YokXSC2Nq/c X-Received: by 2002:a05:6402:5388:b0:435:71b:5d44 with SMTP id ew8-20020a056402538800b00435071b5d44mr42336818edb.364.1658234017667; Tue, 19 Jul 2022 05:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658234017; cv=none; d=google.com; s=arc-20160816; b=qGGQQiUwcIFMl5/A9JTXkvkrG4ZcUuTWxj0H4w4LMSAr85Y2fIhI7zWBmzBV/eN7Ag GNq0NQ57GB+R33NWnMmqASL2dyLfY0sc9eFSzUdpywr1PYpf4mWlR+USUou5KQAERXeC Lx+QuxOGWJgyFBdsB6Bi+g4isoYevx3P6CvXZJxO3CQytaMfdPCHSBdgLPaPYrIKqf13 UqWrriQSaZncAbEwxp2gLnnpq/WM5QouOYM6XU8je2rKbPUoJXLCrwRtK2owlPRPc+DF XYAenc7voT2pfYOLWT67jELvyiXuEkDAaCTzLN9Cutge3gsYV6xCoqheS3M8GS8B261+ LT8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tzMGtmg98xYR0NxhIX1r53CwujEGcC6nYEcuUL9lGjw=; b=yMfuveX9tqlbn+s22EtuqRzRwskLlEtBSjzfCaXr70XcSa6DD/HWfcPxu2YTpwVFQy OwtL19ZTemJ0tTFoElP9vZGPxqSko2Q6sS4VG2eErgrhmcUsIb2uXrh21DWeEuMgBpUT U4/G8PzPCsbbbXsiECzz0d4j5It6k4HCXmTym6FLZssv+8qARBFAKdHvg2jatAgtEXm9 unSYD19MJdBWvkJTvBMLXXyKACIi8dlCr8YLt8pG2MobEcK2pFmb3Y/EG0ZdDWia5XUG 7kBAQIU2XbS1PepOpoaHN46yxmYHuD+AllM/CUMxBxzbRV9vVA2pEKiwgnWtS9axg9+Y rBsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GT5Amh+H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh44-20020a1709076eac00b0072f2ce19e48si9291056ejc.631.2022.07.19.05.33.11; Tue, 19 Jul 2022 05:33:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GT5Amh+H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239559AbiGSMX1 (ORCPT + 99 others); Tue, 19 Jul 2022 08:23:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239562AbiGSMXH (ORCPT ); Tue, 19 Jul 2022 08:23:07 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFE875E315; Tue, 19 Jul 2022 05:08:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 4AB50CE1BE6; Tue, 19 Jul 2022 12:07:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08F94C341C6; Tue, 19 Jul 2022 12:07:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232470; bh=F+g/UHoFgRdUMKnO5CFsIPv3T1WPhvjiuE9ygdi1nt4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GT5Amh+HFUZ9eG8Okt2t8ZT0m18vIP0pvR+s+agMThnleMtanBO3aQmz+DaQ3vnxS CAjhDUqL/0irNdajHMec0+51DpXKLopknnfkjqV1/mwHVWrEJvocHUZjifx+p9Tgvc pKTJN6VZsHUaKNFyRp77vHw/2qtCPXhfaYzV2Rck= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrea Mayer , Paolo Abeni , Sasha Levin Subject: [PATCH 5.10 069/112] seg6: fix skb checksum in SRv6 End.B6 and End.B6.Encaps behaviors Date: Tue, 19 Jul 2022 13:54:02 +0200 Message-Id: <20220719114633.167685719@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114626.156073229@linuxfoundation.org> References: <20220719114626.156073229@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrea Mayer [ Upstream commit f048880fc77058d864aff5c674af7918b30f312a ] The SRv6 End.B6 and End.B6.Encaps behaviors rely on functions seg6_do_srh_{encap,inline}() to, respectively: i) encapsulate the packet within an outer IPv6 header with the specified Segment Routing Header (SRH); ii) insert the specified SRH directly after the IPv6 header of the packet. This patch removes the initialization of the IPv6 header payload length from the input_action_end_b6{_encap}() functions, as it is now handled properly by seg6_do_srh_{encap,inline}() to avoid corruption of the skb checksum. Fixes: 140f04c33bbc ("ipv6: sr: implement several seg6local actions") Signed-off-by: Andrea Mayer Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- net/ipv6/seg6_local.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c index eba23279912d..11f7da4139f6 100644 --- a/net/ipv6/seg6_local.c +++ b/net/ipv6/seg6_local.c @@ -435,7 +435,6 @@ static int input_action_end_b6(struct sk_buff *skb, struct seg6_local_lwt *slwt) if (err) goto drop; - ipv6_hdr(skb)->payload_len = htons(skb->len - sizeof(struct ipv6hdr)); skb_set_transport_header(skb, sizeof(struct ipv6hdr)); seg6_lookup_nexthop(skb, NULL, 0); @@ -467,7 +466,6 @@ static int input_action_end_b6_encap(struct sk_buff *skb, if (err) goto drop; - ipv6_hdr(skb)->payload_len = htons(skb->len - sizeof(struct ipv6hdr)); skb_set_transport_header(skb, sizeof(struct ipv6hdr)); seg6_lookup_nexthop(skb, NULL, 0); -- 2.35.1