From 59380169042c1a7c4ec030ec27f937d8281e69fa Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Tue, 5 Aug 2014 16:23:26 +0200 Subject: [PATCH] dhclient-script: it's OK if the arping reply comes from our system (#1116004) --- dhclient-script | 13 ++++++++++--- dhcp.spec | 7 +++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/dhclient-script b/dhclient-script index 364bd94..4d9e6fb 100644 --- a/dhclient-script +++ b/dhclient-script @@ -720,9 +720,16 @@ case "${reason}" in if arping -D -q -c2 -I ${interface} ${new_ip_address}; then dhconfig exit_with_hooks 0 - else - # DAD failed, i.e. address is already in use - exit_with_hooks 1 + else # DAD failed, i.e. address is already in use + ARP_REPLY=$(arping -D -c2 -I ${interface} ${new_ip_address} | grep reply | awk '{print toupper($5)}' | cut -d "[" -f2 | cut -d "]" -f1) + OUR_MACS=$(ip link show | grep link | awk '{print toupper($2)}' | uniq) + if [[ "${OUR_MACS}" = *"${ARP_REPLY}"* ]]; then + # the reply can come from our system, that's OK (#1116004#c33) + dhconfig + exit_with_hooks 0 + else + exit_with_hooks 1 + fi fi ;; diff --git a/dhcp.spec b/dhcp.spec index 1ce972d..58fcf2d 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -18,7 +18,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.3.1 -Release: 0.3.%{prever}%{?dist} +Release: 0.4.%{prever}%{?dist} # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # dcantrell maintaining the package) made incorrect use of the epoch and # that's why it is at 12 now. It should have never been used, but it was. @@ -117,7 +117,7 @@ the ISC DHCP service and relay agent. %package -n dhclient Summary: Provides the ISC DHCP client daemon and dhclient-script # dhclient-script requires: -Requires: coreutils grep hostname initscripts iproute iputils sed +Requires: coreutils grep hostname initscripts iproute iputils sed gawk Requires: %{name}-common = %{epoch}:%{version}-%{release} Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} @@ -592,6 +592,9 @@ done %doc doc/html/ %changelog +* Tue Aug 05 2014 Jiri Popelka - 12:4.3.1-0.4.b1 +- dhclient-script: it's OK if the arping reply comes from our system (#1116004) + * Tue Jul 22 2014 Jiri Popelka - 12:4.3.1-0.3.b1 - Use network-online.target instead of network.target (#1120656)