Blame 0117-network-ifup.sh-arping-for-static-IPv4-addresses.patch

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