Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp276459ybj; Wed, 6 May 2020 17:25:49 -0700 (PDT) X-Google-Smtp-Source: APiQypLSEa27SukEBTgM/K/CWAIdHDNApdn7434yN2rCx1FQiJq+Hb5d88olI1IthWqV+CKpr6gR X-Received: by 2002:aa7:d143:: with SMTP id r3mr8876364edo.147.1588811148901; Wed, 06 May 2020 17:25:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588811148; cv=none; d=google.com; s=arc-20160816; b=wH89m1r9GZ0dbpkMQizTjPBbBk1KsAVyhCMzWLYaLHKf9C91N+cd0oCyLUO108rj9L Hsv210WMTUEDHG3OpxMCgukjM3hevBF8iLqIZ7jzCcKK2I+4ZSd62606n+6v62anoIhI 2YPGzuoTcxnTVa9n1Mn196jygzGKBDnzBqXUfNudoFZUrYXFrF/1hjSQ6FYaFv21H4/T gZ/md1ofx0UIBa0n+PqnRuqwPla3YlzYNgmDwq6rQod4zsm9VsasSgvGXRnGsjxeH9M0 aojEuH+cnGwT+9v0mAMls9iwoWByBhjKeWg7g5ebdKWS01JGnYd+AsEgOWgqi7inGwfI GTug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=16S/tAO3KQTPMcczvQzo/ZzM5GAz+SSf0aQvRrgCYM0=; b=X7r6AQzypOiLFqiQ6AnHSKQHdk0jKy46pA+lFsZpL5z4cuv0D4iWe6UdcIgF/E/r28 8Pavxnlo1y4f8zaUAv5Lac+UAzHAN+a71W1iBFZRwwD5oafuKW4svjylpc5TeApgV6C9 Fa1C5H2zGL6TkEGUsQOd+pfJOpJFPKeIpSWkSKlU1JrUpW3imfY84HIH0yMeCjsFGaQ2 XL5h0qxvcBFE5y06VXuZ76kmcUajvhnN9nYsitgw+jrSvwnCEcHVUBKDrbFMK3OOr5mg HR2vusdT+ttIdUpwI6plbps3IHR6qpLj/IycRWNNNcO7Vu4bQw8kfwpUnJf2uOJ1SWhS Myzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r11si2213154eju.467.2020.05.06.17.25.25; Wed, 06 May 2020 17:25:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727771AbgEGAWI (ORCPT + 99 others); Wed, 6 May 2020 20:22:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbgEGAWG (ORCPT ); Wed, 6 May 2020 20:22:06 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CB37C061A0F; Wed, 6 May 2020 17:22:06 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id D6BC81277C589; Wed, 6 May 2020 17:22:05 -0700 (PDT) Date: Wed, 06 May 2020 17:22:05 -0700 (PDT) Message-Id: <20200506.172205.208972233468631933.davem@davemloft.net> To: ahabdels@gmail.com Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dav.lebrun@gmail.com Subject: Re: [net] seg6: fix SRH processing to comply with RFC8754 From: David Miller In-Reply-To: <20200504144211.5613-1-ahabdels@gmail.com> References: <20200504144211.5613-1-ahabdels@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 06 May 2020 17:22:06 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ahmed Abdelsalam Date: Mon, 4 May 2020 14:42:11 +0000 > The Segment Routing Header (SRH) which defines the SRv6 dataplane is defined > in RFC8754. > > RFC8754 (section 4.1) defines the SR source node behavior which encapsulates > packets into an outer IPv6 header and SRH. The SR source node encodes the > full list of Segments that defines the packet path in the SRH. Then, the > first segment from list of Segments is copied into the Destination address > of the outer IPv6 header and the packet is sent to the first hop in its path > towards the destination. > > If the Segment list has only one segment, the SR source node can omit the SRH > as he only segment is added in the destination address. > > RFC8754 (section 4.1.1) defines the Reduced SRH, when a source does not > require the entire SID list to be preserved in the SRH. A reduced SRH does > not contain the first segment of the related SR Policy (the first segment is > the one already in the DA of the IPv6 header), and the Last Entry field is > set to n-2, where n is the number of elements in the SR Policy. > > RFC8754 (section 4.3.1.1) defines the SRH processing and the logic to > validate the SRH (S09, S10, S11) which works for both reduced and > non-reduced behaviors. > > This patch updates seg6_validate_srh() to validate the SRH as per RFC8754. > > Signed-off-by: Ahmed Abdelsalam Applied, thanks.