From: Phil Sutter <phil@nwl.cc>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, Roopa Prabhu <roopa@cumulusnetworks.com>
Subject: Re: [iproute PATCH] ip-link: Fix listing of alias interfaces
Date: Fri, 8 Feb 2019 11:40:57 +0100 [thread overview]
Message-ID: <20190208104057.GE26388@orbyte.nwl.cc> (raw)
In-Reply-To: <20190207162436.4452f7ad@hermes.lan>
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).
Cheers, Phil
next prev parent reply other threads:[~2019-02-08 10:41 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 [this message]
2019-02-08 12:09 ` Michal Kubecek
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=20190208104057.GE26388@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=netdev@vger.kernel.org \
--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).