]> git.proxmox.com Git - mirror_iproute2.git/commit
iproute2: fix the link group name getting error
authorZhang Shengju <zhangshengju@cmss.chinamobile.com>
Fri, 18 Nov 2016 01:12:53 +0000 (09:12 +0800)
committerStephen Hemminger <sthemmin@microsoft.com>
Tue, 29 Nov 2016 20:48:07 +0000 (12:48 -0800)
commit2d98dd482149aa1a2bf509122af089249644a89f
treed39ac01e66a97b75a6421750f81139ac22a37191
parentba7b97776e3a2e019de8d840f9714db89da60a94
iproute2: fix the link group name getting error

In the situation where more than one entry live in the same hash bucket,
loop to get the correct one.

Before:
$ cat /etc/iproute2/group
0 default
256     test

$ sudo ip link set group test dummy1

$ ip link show type dummy
11: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group 0 qlen 1000
    link/ether 4e:3b:d3:6c:f0:e6 brd ff:ff:ff:ff:ff:ff
12: dummy1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group test qlen 1000
    link/ether d6:9c:a4:1f:e7:e5 brd ff:ff:ff:ff:ff:ff

After:
$ ip link show type dummy
11: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 4e:3b:d3:6c:f0:e6 brd ff:ff:ff:ff:ff:ff
12: dummy1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group test qlen 1000
    link/ether d6:9c:a4:1f:e7:e5 brd ff:ff:ff:ff:ff:ff

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
lib/rt_names.c