network/ifup.sh: arping for static IPv4 addresses

(cherry picked from commit 38180271c5)
master
Harald Hoyer 2015-08-18 12:07:41 +02:00
parent 93b9885a65
commit 9ab5ddf16a
1 changed files with 4 additions and 0 deletions

View File

@ -158,6 +158,10 @@ do_static() {
ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
wait_for_ipv6_dad $netif
else
if ! arping -f -q -D -c 2 -I $netif $ip; then
warn "Duplicate address detected for $ip for interface $netif."
return 1
fi
ip addr flush dev $netif
ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif
fi