]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Add DAD to dhclient-script
authorPhilippe Seewer <philippe.seewer@bfh.ch>
Thu, 17 Sep 2009 15:16:46 +0000 (17:16 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 6 Oct 2009 13:17:39 +0000 (15:17 +0200)
The manpage for dhclient-script says:

Before actually configuring the address, dhclient-script should
somehow ARP for it and exit with a nonzero status if it receives a
reply.

By using arping in dracut this is very easy, since arping has a
specific option to do just that.

modules.d/40network/dhclient-script

index 54ec2f568b3a7a95b07ab0eeaa8090ef9b4c9c08..0bbdcfc62e8269c1e66ec5949d2efb8161408c40 100755 (executable)
@@ -64,6 +64,10 @@ case $reason in
        wait_for_if_up $netif
        ;;
     BOUND)
+       if ! arping -q -D -c 2 -I $netif $new_ip_address ; then
+           warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
+           exit 1
+       fi
        setup_interface 
        set | while read line; do
            [ "${line#new_}" = "$line" ] && continue