diff options
author | mbr <mbr@FreeBSD.org> | 2004-08-16 15:48:02 +0000 |
---|---|---|
committer | mbr <mbr@FreeBSD.org> | 2004-08-16 15:48:02 +0000 |
commit | 9cbc7c3e683b465bb1f6fda8b4dba4658a206355 (patch) | |
tree | 1e2a9e51b0ecad4f80691aef5668b78030c13111 /contrib | |
parent | 24ad8a984216ddd6cda66a3325a55fe6bd74b88c (diff) | |
download | FreeBSD-src-9cbc7c3e683b465bb1f6fda8b4dba4658a206355.zip FreeBSD-src-9cbc7c3e683b465bb1f6fda8b4dba4658a206355.tar.gz |
Sync a reverted part of dhclient.c with the vendor source. It seems
that a buxfix from rc14 got backed out again. We do the same.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/isc-dhcp/client/dhclient.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/contrib/isc-dhcp/client/dhclient.c b/contrib/isc-dhcp/client/dhclient.c index 1b90541..8354fe6 100644 --- a/contrib/isc-dhcp/client/dhclient.c +++ b/contrib/isc-dhcp/client/dhclient.c @@ -838,15 +838,11 @@ void dhcpack (packet) /* If it wasn't specified by the server, calculate it. */ if (!client -> new -> renewal) - client -> new -> renewal = client -> new -> expiry / 2 + 1; - - if (client -> new -> renewal <= 0) - client -> new -> renewal = TIME_MAX; + client -> new -> renewal = + client -> new -> expiry / 2; /* Now introduce some randomness to the renewal time: */ - if (client -> new -> renewal <= TIME_MAX / 3 - 3) - client -> new -> renewal = - (((client -> new -> renewal + 3) * 3 / 4) + + client -> new -> renewal = (((client -> new -> renewal + 3) * 3 / 4) + (random () % /* XXX NUMS */ ((client -> new -> renewal + 3) / 4))); @@ -865,25 +861,14 @@ void dhcpack (packet) } else client -> new -> rebind = 0; - if (client -> new -> rebind <= 0) { - if (client -> new -> expiry <= TIME_MAX / 7) - client -> new -> rebind = - client -> new -> expiry * 7 / 8; - else - client -> new -> rebind = - client -> new -> expiry / 8 * 7; - } + if (!client -> new -> rebind) + client -> new -> rebind = + (client -> new -> expiry * 7) / 8; /* XXX NUMS */ /* Make sure our randomness didn't run the renewal time past the rebind time. */ - if (client -> new -> renewal > client -> new -> rebind) { - if (client -> new -> rebind <= TIME_MAX / 3) - client -> new -> renewal = - client -> new -> rebind * 3 / 4; - else - client -> new -> renewal = - client -> new -> rebind / 4 * 3; - } + if (client -> new -> renewal > client -> new -> rebind) + client -> new -> renewal = (client -> new -> rebind * 3) / 4; client -> new -> expiry += cur_time; /* Lease lengths can never be negative. */ |