]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network/ifup.sh: arping for static IPv4 addresses
authorHarald Hoyer <harald@redhat.com>
Tue, 18 Aug 2015 10:07:41 +0000 (12:07 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 18 Aug 2015 10:07:41 +0000 (12:07 +0200)
modules.d/40network/ifup.sh

index ab87578e249ae232637633a4e4ffb605ee901796..8a5a6065196d74e82bdf2124420e5383397ddbef 100755 (executable)
@@ -163,6 +163,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