From cc3f588071c35821b55e1db2201b0650df688dcc Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 30 Jun 2016 11:11:37 +0200
Subject: [PATCH] network: flush only IPv4 addresses on configuration
also flush on dhcp
---
modules.d/40network/ifup.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
index 19b7bbdc..cedf9a77 100755
--- a/modules.d/40network/ifup.sh
+++ b/modules.d/40network/ifup.sh
@@ -112,6 +112,7 @@ do_dhcp() {
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
+ ip -4 addr flush dev $netif
while [ $_COUNT -lt $_DHCPRETRY ]; do
info "Starting dhcp for interface $netif"
@@ -188,7 +189,7 @@ do_static() {
warn "Duplicate address detected for $ip for interface $netif."
return 1
fi
- ip addr flush dev $netif
+ ip -4 addr flush dev $netif
ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif
fi