From patchwork Fri Jan 15 18:42:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matteo Croce X-Patchwork-Id: 12023819 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F6DCC433E0 for ; Fri, 15 Jan 2021 18:44:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EEC8C23A5A for ; Fri, 15 Jan 2021 18:44:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733286AbhAOSnt (ORCPT ); Fri, 15 Jan 2021 13:43:49 -0500 Received: from mail-wr1-f50.google.com ([209.85.221.50]:41116 "EHLO mail-wr1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727863AbhAOSnt (ORCPT ); Fri, 15 Jan 2021 13:43:49 -0500 Received: by mail-wr1-f50.google.com with SMTP id a12so10258589wrv.8; Fri, 15 Jan 2021 10:43:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+794t8aJWFKiUG7Y4A7+DFW3GISGeN1bFWGcWCBpz7o=; b=KVgDaqLbgC3yDQUs5Wo6AdZ0JGi6qteRSjq79TXcoWC1/oRFzqT3tYnqLpsdXMrKju seGkUg9eboqkPW2ZlaTErtXB/hg5+B2uomsldfm4l9YDA2bWXhoa0YiWKW0uZ5WSbgdr AWmIn7Sf9kvdhmZtoV+8IyOOq//p1/Ms03mTQN0qGKc1KBfVFETMTO68PwyqvnmjNFq/ v41wHfP0/AEYfMuERRW96BSFwAQQJEf3VFP5t7Ddo5mlpyFl1AaEIpqzg47D9Zga39A3 CAcEDS3LeVGoQCa26P6fJRsWnpGSPw8SFwizSS8RW4BOaFYfVBfuoFNb9aRpC3sFwBoo 0yGg== X-Gm-Message-State: AOAM531iVMi2mWxeviPZayDTfwKa1u6eoZhiqlApVH4/BFW9LDborXXS PxKGCOy43NKP0d7e87tjzGx7dW1qkuf6hQ== X-Google-Smtp-Source: ABdhPJw/ynUlSRPRgKj8IK2ryzYiUkgGdFBRVf0GuTg+PNpFi47rqm6AmydaAJ3ac6bWAw7QGFY8+Q== X-Received: by 2002:a5d:62c8:: with SMTP id o8mr14814821wrv.51.1610736187200; Fri, 15 Jan 2021 10:43:07 -0800 (PST) Received: from msft-t490s.fritz.box (host-80-116-27-12.pool80116.interbusiness.it. [80.116.27.12]) by smtp.gmail.com with ESMTPSA id z6sm12881529wmi.15.2021.01.15.10.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 10:43:06 -0800 (PST) From: Matteo Croce To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "David S. Miller" , Hideaki YOSHIFUJI , Jakub Kicinski Subject: [PATCH net 1/2] ipv6: create multicast route with RTPROT_KERNEL Date: Fri, 15 Jan 2021 19:42:08 +0100 Message-Id: <20210115184209.78611-2-mcroce@linux.microsoft.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210115184209.78611-1-mcroce@linux.microsoft.com> References: <20210115184209.78611-1-mcroce@linux.microsoft.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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); From patchwork Fri Jan 15 18:42:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matteo Croce X-Patchwork-Id: 12023821 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08280C433E0 for ; Fri, 15 Jan 2021 18:45:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C361023A59 for ; Fri, 15 Jan 2021 18:45:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387623AbhAOSol (ORCPT ); Fri, 15 Jan 2021 13:44:41 -0500 Received: from mail-wm1-f53.google.com ([209.85.128.53]:54903 "EHLO mail-wm1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387533AbhAOSok (ORCPT ); Fri, 15 Jan 2021 13:44:40 -0500 Received: by mail-wm1-f53.google.com with SMTP id i63so8294760wma.4; Fri, 15 Jan 2021 10:44:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8gwIOY/GKLF64xOgYxUdqP4ghmyuqyfb19XQrB6veDY=; b=mwQ4Wqt/FZss1o0Dlg1Gzfyw7Aafmnsv91ttNB03bFtT+ZP3xMOkvq6eiEuOoMu3d5 OLcfRE+9P2PcdMxkXsO+7u4cGDFAsEk3k+L4zj5ZC1BG/2v9K4xaMUPIoqBF8rC2ovhA IX57h1Xfapll4QpQYzx7rpGQiCFISnrVZhJdwZTBRMqg1z/MGGfl7JWOllq4oGJgcvIK RUxPNuJ1YsdxVi0D4Rw2+n/JlrbaHodPB+Mlqj2soPjb1+Dk5ZqE3ikwpbUmHJ678BRx ndAmNLWgCekZ0tnROWYIdV4Bu9VCi0xa6ThgxmpF26FQuhcJrLVW6y9MtdVRde16MuPG EJ3A== X-Gm-Message-State: AOAM5302rLSvxYZT7uc1kZdjx8Sc/f3dHN39Noau4VX8o3328RfG4yak YqKjO12bXFGelLGwK6Kh1Xi7mu4gIaMZWg== X-Google-Smtp-Source: ABdhPJyfHCUAUXw6dFZ4Ae1ivDcq5R7Z1cNheYMe89+NkfFJ1qjZq4gzgQRIga0sM+ZGnTf4Ccvlig== X-Received: by 2002:a05:600c:22d9:: with SMTP id 25mr9831227wmg.158.1610736238438; Fri, 15 Jan 2021 10:43:58 -0800 (PST) Received: from msft-t490s.fritz.box (host-80-116-27-12.pool80116.interbusiness.it. [80.116.27.12]) by smtp.gmail.com with ESMTPSA id z6sm12881529wmi.15.2021.01.15.10.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 10:43:57 -0800 (PST) From: Matteo Croce To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "David S. Miller" , Hideaki YOSHIFUJI , Jakub Kicinski Subject: [PATCH net 2/2] ipv6: set multicast flag on the multicast route Date: Fri, 15 Jan 2021 19:42:09 +0100 Message-Id: <20210115184209.78611-3-mcroce@linux.microsoft.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210115184209.78611-1-mcroce@linux.microsoft.com> References: <20210115184209.78611-1-mcroce@linux.microsoft.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Matteo Croce The multicast route ff00::/8 is created with type RTN_UNICAST: $ 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 kernel scope global metric 256 pref medium Set the type to RTN_MULTICAST which is more appropriate. Signed-off-by: Matteo Croce --- net/ipv6/addrconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 19bf6822911c..9edc5bb2d531 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -2467,7 +2467,7 @@ static void addrconf_add_mroute(struct net_device *dev) .fc_ifindex = dev->ifindex, .fc_dst_len = 8, .fc_flags = RTF_UP, - .fc_type = RTN_UNICAST, + .fc_type = RTN_MULTICAST, .fc_nlinfo.nl_net = dev_net(dev), .fc_protocol = RTPROT_KERNEL, };