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

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