broken dhclient-script in TIMEOUT case

From: David Xu <davidxu_at_freebsd.org>
Date: Sat, 24 Sep 2005 12:49:43 +0800
It seems script /sbin/dhclient-script is broken in TIMEOUT case.
first, the command parameter is wrong for our ping program, it
passes -w parameter to ping, but our ping can only accept -t,

   if ping -q -c 1 -w 1 "$1"; then

second, the statement:
  eval "ifconfig $interface inet -alias $new_ip_address $medium"

immediately removes the address just configured, result is although
I have setup a lease section, but I can not set the static ip address
after dhcp server timeouts.

Patch is below:
-------------
timeout 5;
retry 60;
reboot 10;
select-timeout 5;
initial-interval 2;
#reject 192.33.137.209;
script "/sbin/dhclient-script";

interface "bge0" {
        send host-name "davidxu-t43.my.domain";
#       send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
        send dhcp-lease-time 3600;
#       supersede domain-name "netease.com";
        prepend domain-name-servers 127.0.0.1;
        request subnet-mask, broadcast-address, time-offset, routers,
                domain-name, domain-name-servers, host-name;
        require subnet-mask, domain-name-servers;
#       media "media 10baseT/UTP", "media 10base2/BNC";
}

lease {
        interface "bge0";
        fixed-address 192.168.1.16;
        option subnet-mask 255.255.255.0;
        option routers 192.168.1.6;
        renew 0 2006/1/1 12:00:00;
        rebind 0 2006/1/1 12:15:00;
        expire 0 2006/1/1 12:30:00;
}
---------------
my sample dhclient.conf:
timeout 5;
retry 60;
reboot 10;
select-timeout 5;
initial-interval 2;
#reject 192.33.137.209;
script "/sbin/dhclient-script";

interface "bge0" {
    send host-name "davidxu-t43.my.domain";
#    send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
    send dhcp-lease-time 3600;
#    supersede domain-name "netease.com";
    prepend domain-name-servers 127.0.0.1;
    request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, host-name;
    require subnet-mask, domain-name-servers;
#    media "media 10baseT/UTP", "media 10base2/BNC";
}

lease {
    interface "bge0";
    fixed-address 192.168.1.16;
    option subnet-mask 255.255.255.0;
    option routers 192.168.1.6;
    renew 0 2006/1/1 12:00:00;
    rebind 0 2006/1/1 12:15:00;
    expire 0 2006/1/1 12:30:00;
}
Received on Sat Sep 24 2005 - 02:49:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:44 UTC