Subject: Re: [iproute PATCH] ip-link: Fix listing of alias interfaces

From: Stephen Hemminger <[email-masked]>
Date: Thu, 7 Feb 2019 16:24:36 -0800

On Thu,  7 Feb 2019 14:05:27 +0100
Phil Sutter <[email-masked]> 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 <[email-masked]>

What about mistaken usage where the text after the colon is not a number,
or has additional colon?