From: Michal Kubecek <mkubecek@suse.cz>
To: netdev@vger.kernel.org
Cc: Phil Sutter <phil@nwl.cc>,
Stephen Hemminger <stephen@networkplumber.org>,
Roopa Prabhu <roopa@cumulusnetworks.com>
Subject: Re: [iproute PATCH] ip-link: Fix listing of alias interfaces
Date: Fri, 8 Feb 2019 13:09:03 +0100 [thread overview]
Message-ID: <20190208120903.GC7035@unicorn.suse.cz> (raw)
In-Reply-To: <20190208104057.GE26388@orbyte.nwl.cc>
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@nwl.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@nwl.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
next prev parent reply other threads:[~2019-02-08 12:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 13:05 [iproute PATCH] ip-link: Fix listing of alias interfaces Phil Sutter
2019-02-08 0:24 ` Stephen Hemminger
2019-02-08 10:40 ` Phil Sutter
2019-02-08 12:09 ` Michal Kubecek [this message]
2019-02-08 17:50 ` David Ahern
2019-02-08 17:56 ` Stephen Hemminger
2019-02-08 18:04 ` Phil Sutter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190208120903.GC7035@unicorn.suse.cz \
--to=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=phil@nwl.cc \
--cc=roopa@cumulusnetworks.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).