[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190208120903.GC7035@unicorn.suse.cz>
Date: Fri, 8 Feb 2019 13:09:03 +0100
From: Michal Kubecek <mkubecek@...e.cz>
To: netdev@...r.kernel.org
Cc: Phil Sutter <phil@....cc>,
Stephen Hemminger <stephen@...workplumber.org>,
Roopa Prabhu <roopa@...ulusnetworks.com>
Subject: Re: [iproute PATCH] ip-link: Fix listing of alias interfaces
On Fri, Feb 08, 2019 at 11:40:57AM +0100, Phil Sutter wrote:
> On Thu, Feb 07, 2019 at 04:24:36PM -0800, Stephen Hemminger wrote:
> > On Thu, 7 Feb 2019 14:05:27 +0100
> > Phil Sutter <phil@....cc> wrote:
> >
> > > Commit 50b9950dd9011 ("link dump filter") accidentally broke listing of
> > > links in the old alias interface notation:
> > >
> > > | % ip link show eth0:1
> > > | RTNETLINK answers: No such device
> > > | Cannot send link get request: No such device
> > >
> > > Prior to the above commit, link lookup was performed via ifindex
> > > returned by if_nametoindex(). The latter uses SIOCGIFINDEX ioctl call
> > > which on kernel side causes the colon-suffix to be dropped before doing
> > > the interface lookup. Netlink API though doesn't care about that at all.
> > > To keep things backward compatible, mimick ioctl API behaviour and drop
> > > the colon-suffix prior to sending the RTM_GETLINK request.
> > >
> > > Fixes: 50b9950dd9011 ("link dump filter")
> > > Signed-off-by: Phil Sutter <phil@....cc>
> >
> > What about mistaken usage where the text after the colon is not a number,
> > or has additional colon?
>
> That's completely ignored in ioctl-case as well. See dev_ioctl() in
> kernel sources:
>
> | colon = strchr(ifr->ifr_name, ':');
> | if (colon)
> | *colon = 0;
>
> If you pass 'group 0' to link show command, ioctl code path is taken. It
> allows (and drops) arbitrary input after the colon (as long as the total
> name doesn't exceed 15 characters).
Not only that, other ip link subcommands also use ioctl for interface
lookup so that e.g. "ip link del dummy1:x" deletes dummy1 without any
complaint.
But as I mentioned earlier in http://patchwork.ozlabs.org/patch/1037934/
I'm not sure this behaviour is really desirable.
Michal Kubecek
Powered by blists - more mailing lists