Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: avoid using ifconfig

ifconfig is deprecated and not always present, use ip command instead.

Fixes: e0f3b3e5c77a ("selftests: Add test cases for vlan_filter modification during runtime")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Dong Chenchen <dongchenchen2@huawei.com>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://patch.msgid.link/20250730115313.3356036-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Eric Dumazet and committed by
Jakub Kicinski
7cbd4979 a4f0866e

+8 -8
+8 -8
tools/testing/selftests/net/vlan_hw_filter.sh
··· 55 55 ip netns exec ${NETNS} ip link add bond0 type bond mode 0 56 56 ip netns exec ${NETNS} ip link add link bond0 name vlan0 type vlan id 0 protocol 802.1q 57 57 ip netns exec ${NETNS} ethtool -K bond0 rx-vlan-filter off 58 - ip netns exec ${NETNS} ifconfig bond0 up 58 + ip netns exec ${NETNS} ip link set dev bond0 up 59 59 ip netns exec ${NETNS} ethtool -K bond0 rx-vlan-filter on 60 - ip netns exec ${NETNS} ifconfig bond0 down 61 - ip netns exec ${NETNS} ifconfig bond0 up 60 + ip netns exec ${NETNS} ip link set dev bond0 down 61 + ip netns exec ${NETNS} ip link set dev bond0 up 62 62 ip netns exec ${NETNS} ip link del vlan0 || fail "Please check vlan HW filter function" 63 63 cleanup 64 64 } ··· 68 68 setup 69 69 ip netns exec ${NETNS} ip link add bond0 type bond mode 0 70 70 ip netns exec ${NETNS} ethtool -K bond0 rx-vlan-filter off 71 - ip netns exec ${NETNS} ifconfig bond0 up 71 + ip netns exec ${NETNS} ip link set dev bond0 up 72 72 ip netns exec ${NETNS} ethtool -K bond0 rx-vlan-filter on 73 73 ip netns exec ${NETNS} ip link add link bond0 name vlan0 type vlan id 0 protocol 802.1q 74 - ip netns exec ${NETNS} ifconfig bond0 down 75 - ip netns exec ${NETNS} ifconfig bond0 up 74 + ip netns exec ${NETNS} ip link set dev bond0 down 75 + ip netns exec ${NETNS} ip link set dev bond0 up 76 76 ip netns exec ${NETNS} ip link del vlan0 || fail "Please check vlan HW filter function" 77 77 cleanup 78 78 } ··· 84 84 ip netns exec ${NETNS} ip link add bond0 type bond mode 0 85 85 ip netns exec ${NETNS} ip link add link bond0 name vlan0 type vlan id 0 protocol 802.1q 86 86 ip netns exec ${NETNS} ethtool -K bond0 rx-vlan-filter off 87 - ip netns exec ${NETNS} ifconfig bond0 up 87 + ip netns exec ${NETNS} ip link set dev bond0 up 88 88 ip netns exec ${NETNS} ethtool -K bond0 rx-vlan-filter on 89 - ip netns exec ${NETNS} ifconfig bond0 down 89 + ip netns exec ${NETNS} ip link set dev bond0 down 90 90 ip netns exec ${NETNS} ip link del vlan0 || fail "Please check vlan HW filter function" 91 91 cleanup 92 92 }