Re: network interfaces called "all", "default" or "config"

From: Stephane Chazelas
Date: Fri Aug 15 2014 - 04:34:00 EST


Yes, I know those are also used for the eth0:1 "aliases", but the bug
is, since it is allowed to do

ip link add link eth0 eth0:123 type vlan id 123

Then the

ip link del link eth0 eth0:123

should be allowed as well. Or probably better to avoid confusion

ip link add link eth0 foo:bar type vlan id 123

should not be allowed.

Worse:

ip link add link eth0 foo:bar type vlan id 1
ip link add link eth0 foo type vlan id 2

ip link del foo:bar

deletes foo instead of foo:bar.



On 14 August 2014 19:37, Cong Wang <cwang@xxxxxxxxxxxxxxxx> wrote:
> On Thu, Aug 14, 2014 at 2:41 AM, Stephane Chazelas
> <stephane.chazelas@xxxxxxxxx> wrote:
>> By the way, this is related:
>>
>> $ ip link add link eth0 eth0:123 type vlan id 123
>> $ ip link del link eth0 eth0:123
>> RTNETLINK answers: Operation not supported
>
> Kernel reads "eth0:123" as an alias of "eth0", so it will just
> truncate the dev name into "eth0":
>
>
> ifr.ifr_name[IFNAMSIZ-1] = 0;
>
> colon = strchr(ifr.ifr_name, ':');
> if (colon)
> *colon = 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/