Commit e91ae59
committed
interface: handle name@link from iproute2
Since #1090, iproute2 is preferred over ifconfig, however iproute2
provide the list of network interface in name@link in case an interface
is bound to another one (such as macvtap for example), while the real
interface name is not.
$ ip link show
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 48:21:0b:52:19:22 brd ff:ff:ff:ff:ff:ff
4: eth0.128@eth0: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 48:21:0b:52:19:22 brd ff:ff:ff:ff:ff:ff
bash-completion using name@link as provided by iproute2 output then
provide such name in auto completion list, leading to invalid interface
name when auto completing tcpdump arguments.
$ tcpdump -i <TAB>
eth0 eth0.128@eth0
This commit handle this use case to drop link name after name@.
$ tcpdump -i <TAB>
eth0 eth0.128
See: #1090
See: https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/lib/utils.c?h=v6.15.0#n13061 parent 90ef9a2 commit e91ae59
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1821 | 1821 | | |
1822 | 1822 | | |
1823 | 1823 | | |
1824 | | - | |
| 1824 | + | |
1825 | 1825 | | |
1826 | 1826 | | |
1827 | 1827 | | |
| |||
0 commit comments