On 2/7/18 12:36 AM, Serhey Popovych wrote: >> >> This patch is causing a diff on my system: >> >> # ip -br add sh > /tmp/1 >> # ip/ip -br add sh > /tmp/2 >> # diff /tmp/1 /tmp/2 >> 8c8 >> < veth-out@br3 UP fe80::18a8:89ff:fee7:55c5/64 >> --- >>> veth-out@if7 UP fe80::18a8:89ff:fee7:55c5/64 >> >> So the current ip resolves ifindex 7 to br3: >> >> # ip li sh dev br3 >> 7: br3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master >> vrf3 state UP mode DEFAULT group default qlen 1000 >> >> where your patch causes if%d to be printed. >> > > That's interesting. I guess output comes from ll_idx_n2a() in this > change when both IFLA_LINK and IFLA_LINK_NETNS is seen. > > My guess about this case is following: > > 1) veth-out is of "veth" rtnl kind. (ip -d li sh dev veth-out). > > 2) according to drivers/net/veth.c veth_get_iflink() and > veth_get_link_net() IFLA_LINK and IFLA_LINK_NETNS are taken > from peer device. > > 3) seeing @br3 in current ip output looks confusing according to (2) > as veth do not link to something other than it's peer that is in > different network namespace. > > From (3) I guess @br3 is incorrect value and caused by missing > IFLA_LINK_NETNS handling in old print_linkinfo_brief(): it always > calls ll_index_to_name(). >
you are right; if7 is the right output so the current 'br3' is a bug and it only happens with the brief output.