[dhcp] dhclient-script: arping address in BOUND|RENEW|REBIND|REBOOT (#752116)

Jiří Popelka jpopelka at fedoraproject.org
Fri Nov 11 13:04:30 UTC 2011


commit 9af3b80de369ed5ee1de12b6b15fe6cbfd1abf73
Author: Jiri Popelka <jpopelka at redhat.com>
Date:   Fri Nov 11 14:00:38 2011 +0100

    dhclient-script: arping address in BOUND|RENEW|REBIND|REBOOT (#752116)

 dhclient-script |   19 +++++++++----------
 dhcp.spec       |    5 ++++-
 2 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/dhclient-script b/dhclient-script
index 7762524..a788cf9 100644
--- a/dhclient-script
+++ b/dhclient-script
@@ -642,8 +642,8 @@ old_prefix="$(get_prefix ${old_ip_address} ${old_subnet_mask})"
 alias_prefix="$(get_prefix ${alias_ip_address} ${alias_subnet_mask})"
 
 case "${reason}" in
-    MEDIUM)
-        # Linux doesn't handle mediums (media)
+    MEDIUM|ARPCHECK|ARPSEND)
+        # Do nothing
         exit_with_hooks 0
         ;;
 
@@ -677,20 +677,19 @@ case "${reason}" in
         exit_with_hooks 0
         ;;
 
-    ARPCHECK|ARPSEND)
-        if [ -z "${new_ip_address}" ] || [ -z "${interface}" ] ||
-           arping -q -f -c 2 -w 3 -D -I ${interface} ${new_ip_address}; then
+    BOUND|RENEW|REBIND|REBOOT)
+        if [ -z "${interface}" ] || [ -z "${new_ip_address}" ]; then
+            exit_with_hooks 2
+        fi
+        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
         fi
         ;;
 
-    BOUND|RENEW|REBIND|REBOOT)
-        dhconfig
-        exit_with_hooks 0
-        ;;
-
     BOUND6|RENEW6|REBIND6|DEPREF6)
         dh6config
         exit_with_hooks 0
diff --git a/dhcp.spec b/dhcp.spec
index 3b3eb3c..1b07fac 100644
--- a/dhcp.spec
+++ b/dhcp.spec
@@ -22,7 +22,7 @@
 Summary:  Dynamic host configuration protocol software
 Name:     dhcp
 Version:  4.2.3
-Release:  4%{?dist}
+Release:  5%{?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.
@@ -669,6 +669,9 @@ fi
 %{_initddir}/dhcrelay
 
 %changelog
+* Fri Nov 11 2011 Jiri Popelka <jpopelka at redhat.com> - 12:4.2.3-5
+- dhclient-script: arping address in BOUND|RENEW|REBIND|REBOOT (#752116)
+
 * Wed Oct 26 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 12:4.2.3-4
 - Rebuilt for glibc bug#747377
 


More information about the scm-commits mailing list