Blame SOURCES/0305-network-ifup.sh-arping-for-static-IPv4-addresses.patch

18971c
From 38180271c587f3053710bf38a6cda829d3a7c00f Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Tue, 18 Aug 2015 12:07:41 +0200
18971c
Subject: [PATCH] network/ifup.sh: arping for static IPv4 addresses
18971c
18971c
---
18971c
 modules.d/40network/ifup.sh | 4 ++++
18971c
 1 file changed, 4 insertions(+)
18971c
18971c
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
18971c
index ab87578e..8a5a6065 100755
18971c
--- a/modules.d/40network/ifup.sh
18971c
+++ b/modules.d/40network/ifup.sh
18971c
@@ -163,6 +163,10 @@ do_static() {
18971c
         ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
18971c
         wait_for_ipv6_dad $netif
18971c
     else
18971c
+        if ! arping -f -q -D -c 2 -I $netif $ip; then
18971c
+            warn "Duplicate address detected for $ip for interface $netif."
18971c
+            return 1
18971c
+        fi
18971c
         ip addr flush dev $netif
18971c
         ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif
18971c
     fi