From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f194.google.com ([209.85.192.194]:44760 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718AbeBVXqc (ORCPT ); Thu, 22 Feb 2018 18:46:32 -0500 Received: by mail-pf0-f194.google.com with SMTP id 17so2741673pfw.11 for ; Thu, 22 Feb 2018 15:46:32 -0800 (PST) Subject: Re: [PATCH net-next v2 1/1] net: Allow a rule to track originating protocol From: David Ahern To: Ido Schimmel , Donald Sharp Cc: netdev@vger.kernel.org References: <20180220135558.8469-2-sharpd@cumulusnetworks.com> <20180222082309.GA7140@splinter.mtl.com> <75b4f864-763a-295e-3f8e-e791b10dfe9a@gmail.com> Message-ID: <153c6a8f-e984-41d4-ee9a-db5f1b9ffd4b@gmail.com> Date: Thu, 22 Feb 2018 16:46:29 -0700 MIME-Version: 1.0 In-Reply-To: <75b4f864-763a-295e-3f8e-e791b10dfe9a@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On 2/22/18 10:20 AM, David Ahern wrote: >> This breaks my scripts: >> # ip -4 rule show >> 0: from all lookup local >> 32766: from all lookup main >> 32767: from all lookup default >> >> # ip -4 rule del pref 0 >> RTNETLINK answers: No such file or directory >> >> Using iproute 4.15 in Fedora 27: >> # ip -V >> ip utility, iproute2-ss180129 >> >> Problem is iproute sets protocol to RTPROT_BOOT while rules are >> installed with RTPROT_KERNEL. >> >> Maybe add FRA_PROTOCOL? >> >> Thanks! > > ugh. Another iproute2 bug that the kernel has to deal with. iproute2 has > been using rtm for the ancillary header for rules when it should have > been fib_rule_hdr. That bug allowed someone to set the protocol field to > RTPROT_BOOT which was complete nonsense for rules until Donald's recent > patch. > > That means all FIB rules need to default to RTPROT_BOOT. I hate to > inherit that for the l3mdev rule, but looking at the iproute2 code I > don't see any options. > > Donald: send a patch that changes the protocol for kernel installed > rules to RTPROT_BOOT. > After more thinking, Donald is going move the protocol to an FRA_PROTOCOL attribute as you suggested. That avoids breaking legacy iproute2 and allows us to keep a sane default protocol value.