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

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