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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT 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 71B64C282C2 for ; Thu, 7 Feb 2019 13:53:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3731321908 for ; Thu, 7 Feb 2019 13:53:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726894AbfBGNxC (ORCPT ); Thu, 7 Feb 2019 08:53:02 -0500 Received: from orbyte.nwl.cc ([151.80.46.58]:42104 "EHLO orbyte.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726795AbfBGNxB (ORCPT ); Thu, 7 Feb 2019 08:53:01 -0500 Received: from n0-1 by orbyte.nwl.cc with local (Exim 4.91) (envelope-from ) id 1grk6t-00033F-Ga; Thu, 07 Feb 2019 14:52:59 +0100 Date: Thu, 7 Feb 2019 14:52:59 +0100 From: Phil Sutter To: Michal Kubecek Cc: netdev@vger.kernel.org, David Miller Subject: Re: [net-next PATCH] net: rtnetlink: Support alias interfaces with RTM_GETLINK Message-ID: <20190207135259.GY26388@orbyte.nwl.cc> Mail-Followup-To: Phil Sutter , Michal Kubecek , netdev@vger.kernel.org, David Miller References: <20190207102438.21448-1-phil@nwl.cc> <20190207122728.GW26388@orbyte.nwl.cc> <20190207123939.GE18410@unicorn.suse.cz> <20190207130215.GX26388@orbyte.nwl.cc> <20190207132156.GF18410@unicorn.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190207132156.GF18410@unicorn.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Feb 07, 2019 at 02:21:56PM +0100, Michal Kubecek wrote: > On Thu, Feb 07, 2019 at 02:02:15PM +0100, Phil Sutter wrote: > > On Thu, Feb 07, 2019 at 01:39:39PM +0100, Michal Kubecek wrote: > > > > > But I still don't think it would be a good idea. It's bad enough that > > > (as I just learned to my surprise) "ip link del dummy1:0" deletes dummy1 > > > without any complaint because ip uses SIOCGIFINDEX ioctl for ifindex > > > lookup. > > > > I'm struggling a bit with all this. The original problem is iproute2 > > commit 50b9950dd9011 ("link dump filter") which changed 'ip link show' > > to not use if_indextoname() when given just an interface name. So lookup > > happens by name (via RTM_GETLINK) and consequently 'ip link show eth0:1' > > doesn't give link stats of eth0 anymore. > > I would rather consider it a bug that it ever did. It's quite harmless > with "show" but with "set" or "delete", the effect can be quite > disastrous. Yes, you're right. And unless maintainers care about this compatibility, I guess these monsters will slowly disappear as things progress towards netlink. > We want to preserve backward compatibility in general but iproute2 > commit 50b9950dd901 is 4.5 years old and nobody seems to have complained > about the change in behaviour until now. Well, enterprise distributions deliberately try to prevent those changes from hitting their customers. And (perfect match), these users are the least tolerating ones. :) > > Given that iproute2 is supposed to be backwards compatible, the only > > valid option I see is to make sure netlink API calls like the above > > behave identical to the ioctl ones they replace. Which means allowing > > for 'ip link show eth0:42' even if there's no address with that label > > assigned to eth0 as well as your example above. > > One reason why I don't like this idea is that iproute2 is not the only > user of rtnetlink interface. There is wicked and glibc for sure, most > likely also NetworkManager (don't remember) and systemd-networkd (didn't > check) and certainly many others I never heard of. Changing the logic > in kernel rtnetlink implementation would affect all of them. > > If we want to restore the old behaviour of ip (which I'm not convinced > of), it would make more sense to me to strip the :* suffix in iproute2. I just sent a patch, let's see what userspace has to say about it. Thanks, Phil