Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp210425pxb; Mon, 11 Apr 2022 23:22:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqpDnzhkVtYiIZoog5zocU9g4UFMeakqdP21+3StMNVW7K2qPkpcDDxJRYtKtSaPlkygsW X-Received: by 2002:a17:902:834a:b0:14f:3337:35de with SMTP id z10-20020a170902834a00b0014f333735demr36336242pln.8.1649744552738; Mon, 11 Apr 2022 23:22:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649744552; cv=none; d=google.com; s=arc-20160816; b=SLZ85jTfibnyzWNG61JVUkI0yK+qtYdZr/vX893q3LF126V0DTaKhPG6GJt4xCHo+e a2MJxYgN/2FNsaT60N56scKeY0N/Pf27t/8i73AatB8xL4aAovvBPKzZP1dJvsiBuaqU IPJil7swlVvny3ZHE0Q+PCFuudb0QSMM9sSXphnQlgR+HzaivuGLbqZxG3fhU5fHCLIN jhtWSlP6+s+fTAHNYbSQFODYfeJJNFTS2UP/KFA6xEHolxhM8jlLsJUD4WUYkgiktTxv 7+zSRZ5aogixmfeadU8sX3cExdehWhDdazOH2qjwyoqkgID5Xu/5POas3KUE9JUy4l20 gLdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=CKSVJq8qyQSm9E+7b2Am3lv3FrkvK7wUmRfkto+stTY=; b=vAr2zL2hg0ZY3PM2pM0PbkaeKu8TkUHPYKRvNZnKbPNddVbSOHKT7NoHJj6xA5sM30 +itpPxjoN43HkV8dkVuykL8rGp717w05FLT/XW28EXYOEOmItBX10Q3Kke7Dikdsb5Ve thGZIChvta61lw43VezvdF4KdvyiOxi+vFSL8/zLUdjhYsEOu7Re6oYDH0+vNOHuiVjF AXBAPgV3Ys70+yDTc/TM4x32T3P/jyy0I2uoOM2/pD4jRQtHB5M3O6gmCWkLwqNsjU0h vU2mhAYhcAbUUHrT0ujzDJ+AB2nbyZ9aCkYHbXS0fP885x7iky5o7b5Cd/yd0432xO2m LJtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=google header.b=Py6byB+z; 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=REJECT sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a170903120500b00153b2d165f6si11550296plh.510.2022.04.11.23.22.18; Mon, 11 Apr 2022 23:22:32 -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=@arista.com header.s=google header.b=Py6byB+z; 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=REJECT sp=REJECT dis=NONE) header.from=arista.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245209AbiDKPnu (ORCPT + 99 others); Mon, 11 Apr 2022 11:43:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348098AbiDKPns (ORCPT ); Mon, 11 Apr 2022 11:43:48 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 112FF3A732 for ; Mon, 11 Apr 2022 08:41:33 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id p25so8176698pfn.13 for ; Mon, 11 Apr 2022 08:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CKSVJq8qyQSm9E+7b2Am3lv3FrkvK7wUmRfkto+stTY=; b=Py6byB+z+qm6GT/cyQ9H3VDiviPg9AOykgcnGDtEPmbJc8P5o7Ee2DRaIziq9LcT70 rW4lbxFTez6VrSm/K2HtLMyUJ1Oy2GCTkdgPYGb2YKxJLpaBN3F5Uc3SSIYRshGjHgOS irSJynYCofXZzSKJsMVD4fgj11ROaQIxOjBJtcDWcK/7gHrxehYg6ILUWbXFcWDErrac 1kja8yuN9bCfuOuLEitP+D6aT3quzYaj9hDjHrsS3gNyj2ATBTftYsXSSDQ9WPX2MNKh YMNJwkjclPARHpRBpUM6r0108ZFRcCC8+aI0QT5qxWXeEE5YYzxEwpuJ+H+gg3gGHHkZ 0KFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CKSVJq8qyQSm9E+7b2Am3lv3FrkvK7wUmRfkto+stTY=; b=quOpyO5BOTtU5voQM3XTzkz+jtFp8igy+LBY3okq7DV7BercQjy9iqpk5nOuhS4u7t MZ9Gcjcl71IPCILvWa2ouQf7ixUPKY97RL9ibOxU1chqL7eJNdCf/PReMrLdpKpFS/YJ 2QwM0kCWor0xR1VlgkfiIOgwiI4PXoLS3chQhXMjLUm7tbFmF7+X5JqiAMgDxo7F7xt1 woADrYZ1/gkiPNN5G+nW6SEiFlqRxsOmwtIHRZiZJR2CWd4oRhYU16RHGCVk68QEp98V RRSNlF5aFYnz0Hq/36xN+tzx6iefn8wolbq4fZtQfEoZMUliJs3SR8/PhGZnYDo41JhW K/sw== X-Gm-Message-State: AOAM533vo43GUjjQD5jQ6VWmAfpXvMLII9sjRUkseQ2h3Q2JlUCxH4sG vUAbHFE8itnawt7ZMdkebL/uHaCpQSgizLtHb2h4kQ== X-Received: by 2002:a63:1557:0:b0:39d:8460:2e07 with SMTP id 23-20020a631557000000b0039d84602e07mr969931pgv.344.1649691692235; Mon, 11 Apr 2022 08:41:32 -0700 (PDT) MIME-Version: 1.0 References: <20220407074428.1623-1-aajith@arista.com> In-Reply-To: From: Arun Ajith S Date: Mon, 11 Apr 2022 21:11:18 +0530 Message-ID: Subject: Re: [PATCH net-next v2] net/ipv6: Introduce accept_unsolicited_na knob to implement router-side changes for RFC9131 To: David Ahern Cc: netdev@vger.kernel.org, davem@davemloft.net, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, yoshfuji@linux-ipv6.org, kuba@kernel.org, pabeni@redhat.com, corbet@lwn.net, prestwoj@gmail.com, gilligan@arista.com, noureddine@arista.com, gk@arista.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Hi David, Thank you very much for the review. I will make the changes you suggested. Please see inline the question about mausezahn. On Sat, Apr 9, 2022 at 6:48 AM David Ahern wrote: > > On 4/7/22 1:44 AM, Arun Ajith S wrote: > > Add a new neighbour cache entry in STALE state for routers on receiving > > an unsolicited (gratuitous) neighbour advertisement with > > target link-layer-address option specified. > > This is similar to the arp_accept configuration for IPv4. > > A new sysctl endpoint is created to turn on this behaviour: > > /proc/sys/net/ipv6/conf/interface/accept_unsolicited_na. > > > > Signed-off-by: Arun Ajith S > > Tested-by: Arun Ajith S > > you don't need the Tested-by line since you wrote the patch; you are > expected to test it. > > > > diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c > > index 1afc4c024981..1b4d278d0454 100644 > > --- a/net/ipv6/addrconf.c > > +++ b/net/ipv6/addrconf.c > > @@ -5587,6 +5587,7 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf, > > array[DEVCONF_IOAM6_ID] = cnf->ioam6_id; > > array[DEVCONF_IOAM6_ID_WIDE] = cnf->ioam6_id_wide; > > array[DEVCONF_NDISC_EVICT_NOCARRIER] = cnf->ndisc_evict_nocarrier; > > + array[DEVCONF_ACCEPT_UNSOLICITED_NA] = cnf->accept_unsolicited_na; > > } > > > > static inline size_t inet6_ifla6_size(void) > > @@ -7037,6 +7038,13 @@ static const struct ctl_table addrconf_sysctl[] = { > > .extra1 = (void *)SYSCTL_ZERO, > > .extra2 = (void *)SYSCTL_ONE, > > }, > > + { > > + .procname = "accept_unsolicited_na", > > + .data = &ipv6_devconf.accept_unsolicited_na, > > + .maxlen = sizeof(int), > > + .mode = 0644, > > + .proc_handler = proc_dointvec, > > + }, > > I realize drop_unsolicited_na does not have limits, but this is a new > sysctl - add the upper and lower bounds via extra1 and extra2 arguments. > > > > also, please add test cases under tools/testing/selftests/net. You can > use fib_tests.sh as a template. mausezahn is already used in a number of > tests; it should be able to create the NA packets. Be sure to cover > combinations of drop and accept settings. mausezahn doesn't have good support for ICMPv6. I tried using --type icmp6 -t icmp6 "type=136, payload=" to manually craft a NA packet with the target address and the target ll addr option. But it still doesn't allow me to set the flags to mark it as an unsolicited advertisement. How about this alternative for a test: 1. Setup a veth tunnel across two namespaces, one end being the host and the other the router. 2. On the host side, I can configure net.ipv6.conf..ndisc_notify to send out unsolicited NAs. 3. On the router side, I can try out various combinations of (accept_unsolicited_na, drop_unsolicted_na and forwarding) Thanks, Arun