Commit bb2bd090 authored by Florian Westphal's avatar Florian Westphal Committed by David S. Miller

selftests: rtnetlink: add small test case with 'promote_secondaries' enabled

This exercises the 'promote_secondaries' code path.

Without previous fix, this triggers infinite loop/soft lockup:
ifconfig process spinning at 100%, never to return.
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6a9e9cea
...@@ -269,6 +269,25 @@ kci_test_addrlft() ...@@ -269,6 +269,25 @@ kci_test_addrlft()
echo "PASS: preferred_lft addresses have expired" echo "PASS: preferred_lft addresses have expired"
} }
kci_test_promote_secondaries()
{
promote=$(sysctl -n net.ipv4.conf.$devdummy.promote_secondaries)
sysctl -q net.ipv4.conf.$devdummy.promote_secondaries=1
for i in $(seq 2 254);do
IP="10.23.11.$i"
ip -f inet addr add $IP/16 brd + dev "$devdummy"
ifconfig "$devdummy" $IP netmask 255.255.0.0
done
ip addr flush dev "$devdummy"
[ $promote -eq 0 ] && sysctl -q net.ipv4.conf.$devdummy.promote_secondaries=0
echo "PASS: promote_secondaries complete"
}
kci_test_addrlabel() kci_test_addrlabel()
{ {
ret=0 ret=0
...@@ -1161,6 +1180,7 @@ kci_test_rtnl() ...@@ -1161,6 +1180,7 @@ kci_test_rtnl()
kci_test_polrouting kci_test_polrouting
kci_test_route_get kci_test_route_get
kci_test_addrlft kci_test_addrlft
kci_test_promote_secondaries
kci_test_tc kci_test_tc
kci_test_gre kci_test_gre
kci_test_gretap kci_test_gretap
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment