Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp693422pxb; Sat, 16 Jan 2021 04:19:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyq6pjd+bxXer7KzaTG9dCZkuE7nvMvZvBMNzI4O2A/ObTC61/AATTH48ZX4z6DnRwX2jKR X-Received: by 2002:a05:6402:26c9:: with SMTP id x9mr96696edd.365.1610799575218; Sat, 16 Jan 2021 04:19:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610799575; cv=none; d=google.com; s=arc-20160816; b=UQTmcoTEIdy/Vj2vOoo+w4wHl3K4IVNud43Jy236aq/aojr+nRM/qCjJRVTOHBYMyS xCNsT9lICtsVT+CYg5SD+ZHJTwQZXq6lM9sjpbBiMOIiKjW3pLnDFXp27ZmEacDY0QBs r8l7FwHGwfOzuhZTbregBqOe6shOVNLCrHR7iGWUdB6nAebr0l3OHp8Wfvhmk9tPJ4wo Qo5dt5VZuquRT2FAjyea5UiJK+utd9EKItIZFynm3nTxCsWwt3lmXYINA1lm782fiYNN udirLxd5XqulwWY2QAxZO01EIsDLPI66wYgCiOHZVSz7KMMZgVgsDeJPTRYussCSg2py T48w== 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:dkim-filter; bh=TiCwXpfNxrHR/rVBKoD+4jzbb0V5jvO5CtAr07KA7b4=; b=K5x9tCOMK5hTqiHFUX+txkSp/EAhDut62MwTdBe4zvGyBof0Uc2UkOJYQKY7LiiOdA I4W8JfbTKtZD91iFjKstEWfesreQog/goZ05T0foRQqNFf70bWob/CAxj/80mOln+SH4 zNJlvEFHdtO7v1h/MA2E9s3ILjX0RVKWg2Bcr8m3/x2mwrsANKr9KFT/lWqD1RnDLxAX wM3hTLHFxWMOnkWH1urDMEZrye6Qp0PZYZjXeJsFquh9hajXlT8v4Pmg3EUO29lDHNGs S82SUi5ZtyTj5rQ9QJvzvmx1ywcyLgC4V9yTzlpNHiqICccqMkOqh10VB+U6swl9KFAo XwBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=FO0TCmhL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si5823064edv.195.2021.01.16.04.19.11; Sat, 16 Jan 2021 04:19:35 -0800 (PST) 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; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=FO0TCmhL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726507AbhAPMSU (ORCPT + 99 others); Sat, 16 Jan 2021 07:18:20 -0500 Received: from linux.microsoft.com ([13.77.154.182]:53794 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725979AbhAPMST (ORCPT ); Sat, 16 Jan 2021 07:18:19 -0500 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by linux.microsoft.com (Postfix) with ESMTPSA id 08D2820B6C43; Sat, 16 Jan 2021 04:17:37 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 08D2820B6C43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1610799458; bh=TiCwXpfNxrHR/rVBKoD+4jzbb0V5jvO5CtAr07KA7b4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=FO0TCmhLHELPfEZaGGJ2Ue7EOY0mxm7TR6/KNWk+yIV83ZMKVI8VRUMQseEuVJZtP BMjGwraxbpbiV6l9LhYJXvyj4HGnQ4XH+7zmPxO2Z80FHUy6wMc64u3c6etJbiT43d GtzWT4XWoT8I/0SUGC33d5do1j/OUUwLopL9PgAw= Received: by mail-pf1-f169.google.com with SMTP id j12so91469pfj.12; Sat, 16 Jan 2021 04:17:37 -0800 (PST) X-Gm-Message-State: AOAM533tUsznodFDzI+LHeJ/mYHCoz9vItYxUrGIZqFH6Z+u56hIXOX8 WY7ZYsev3x6iy+ZSFgXZpRvUUcaQG2sqslBcg30= X-Received: by 2002:a63:703:: with SMTP id 3mr1000997pgh.272.1610799457391; Sat, 16 Jan 2021 04:17:37 -0800 (PST) MIME-Version: 1.0 References: <20210115184209.78611-1-mcroce@linux.microsoft.com> <20210115184209.78611-2-mcroce@linux.microsoft.com> <5a553d08-2b3f-79a2-2c0e-b1ad644a43d4@gmail.com> In-Reply-To: <5a553d08-2b3f-79a2-2c0e-b1ad644a43d4@gmail.com> From: Matteo Croce Date: Sat, 16 Jan 2021 13:17:01 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net 1/2] ipv6: create multicast route with RTPROT_KERNEL To: David Ahern Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , Hideaki YOSHIFUJI , Jakub Kicinski Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 16, 2021 at 5:36 AM David Ahern wrote: > > On 1/15/21 11:42 AM, Matteo Croce wrote: > > From: Matteo Croce > > > > The ff00::/8 multicast route is created without specifying the fc_protocol > > field, so the default RTPROT_BOOT value is used: > > > > $ ip -6 -d route > > unicast ::1 dev lo proto kernel scope global metric 256 pref medium > > unicast fe80::/64 dev eth0 proto kernel scope global metric 256 pref medium > > unicast ff00::/8 dev eth0 proto boot scope global metric 256 pref medium > > > > As the documentation says, this value identifies routes installed during > > boot, but the route is created when interface is set up. > > Change the value to RTPROT_KERNEL which is a better value. > > > > Signed-off-by: Matteo Croce > > --- > > net/ipv6/addrconf.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c > > index eff2cacd5209..19bf6822911c 100644 > > --- a/net/ipv6/addrconf.c > > +++ b/net/ipv6/addrconf.c > > @@ -2469,6 +2469,7 @@ static void addrconf_add_mroute(struct net_device *dev) > > .fc_flags = RTF_UP, > > .fc_type = RTN_UNICAST, > > .fc_nlinfo.nl_net = dev_net(dev), > > + .fc_protocol = RTPROT_KERNEL, > > }; > > > > ipv6_addr_set(&cfg.fc_dst, htonl(0xFF000000), 0, 0, 0); > > > > > What's the motivation for changing this? ie., what s/w cares that it is > kernel vs boot? A practical example: systemd-networkd explicitly ignores routes with kernel flag[1]. Having a different flag leads the daemon to remove the route sooner or later. [1] https://github.com/systemd/systemd/blob/0b81225e5791f660506f7db0ab88078cf296b771/src/network/networkd-routing-policy-rule.c#L675-L677 -- per aspera ad upstream