RC9 of dhclient 3.0.1. This fix will be part of dhclient 3.0.2. It is
also part of the official redhat package.
Submitted by: Jason Vas Dias <jvdias@redhat.com>
Discussed on: dhcp-hackers@isc.org
time as described in the PR below.
It seems that this patch should have been part of the vendor tree but got
accidently missed in the 3.0.1 final version. It will definitly be
part of 3.0.2 but until then it's a long way to go.
Submitted by: ISC (Vendor)
PR: bin/54517
expired but the expire time itself was still valid and in the future.
If this happened we ended up using the state S_RENEW with an
INADDR_BROADCAST address set in the request and dhclient never got
any answer back. The only workaround was to delete the lease file.
Fix this case with a check for the S_RENEW and a fallback to the
S_INIT state.
PR: bin/69361
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
The code has its own TIME type, which is actually defined to time_t,
but it still used u_int32_t in some places.
In addition, dhclient not only had two separate global cur_time
variables, one of which was defined as u_int32_t and the other as
TIME, but cur_time was sometimes shadowed by local variables, leading
to widespread confusion as to which of these variable was being
referenced.
There is a lesson in here somewhere: a decent compiler with warnings
enabled should have caught all of this long before it became a
problem.
This patch has been submitted to the vendor, but it will likely be
some time before they release a version that includes it.
Approved by: mbr
then we need to go to the reboot state or in state_bound it will core on
the de-reference of client -> active -> options since client -> active = NULL.
While we are here, fix the indentation.
Submitted by: Doug Ambrisko <ambrisko@ambrisko.com>
to renew a lease, contact the dhcp-server directly instead of using
INADDR_BROADCAST all the time. This should fix some brain-dead dhcp
server implementations which give you all the time a new IP if the
lease has not yet expired.
Instead of using ICMP to check if the server is alive, we just check
the return value of sendto() and additionally have a timeout there.
more clear what it does.
Trim interface_active() to just do what it should do. Check
if we got link or not and if the NIC supports it. No special
treatment for mediachecks here anymore.
Simplify the code a lot, and remove doublicated parts.
Fix two minor spelling errors.
Add one missing #ifdef ENABLE_POLLING_MODE
Reviewed by: mdodd
- Rename linkstatus to linkstate which is more correct.
- Sort any leases each time we loose and regain link. With the first
version we spammed the dhclient.leases file.
- When there was no link on a interface, polling has been done twice.
This has been fixed with a bigger sleep interval.
- interface_active() now returns only a assumed state of the link.
If we are using media settings, we cannot be sure that the link
actually works. That means we assume that the link is working and
continue to send requests as usual on the interface and loop over
all possible media options. Polling is still done. If your interface
gets suddenly link, dhclient will send a dhcp discover request.
After all media settings have been tried a few times, dhclient will
sleep. If one does change networks very often, it can help to set the
"retry timeout" to a low value like 100 seconds. The default is over
six minutes.
Tested by: Larry Rosenman <ler@lerctr.org>, imp
requests if the interface has an active link. This is a
great benefit if you often change networks with your laptop
and you do not like to kill/restart dhclient all the time.
Changes are automatically detected and the link is refreshed.
The change allows us to start dhclient in background mode
Enable dhclient to poll the interface state and send only
requests if the interface has an active link. This is a
great benefit if you often change networks with your laptop
and you do not like to kill/restart dhclient all the time.
Changes are automatically detected and the link is refreshed.
The change allows us to start dhclient in background mode
while the network cable is not plugged in.
To control the polling interval, the option -i has been
introduced. It takes seconds as parameter, the minimum is
one second, the default is five seconds.
Polling is done in seconds, not microseconds, because dhclient
does internally work with timeouts in seconds.
This change will be part of the next major ISC-dhcpd release.
Tested by: bms, imp, and many many others.
Reviewed by: murray, eivind, dhclient folks
to std{err,out} will not spam /etc/resolv.conf.
Ted Lemon fixed the problem in version 3 of the client, but only for the
pre-daemonized case. Thanks to Brian for pointing that out and helping
to make our future dhclient (v3) better.
Submitted by: brian
types did not match the prototype.
(Note: this is one bug that an Ada compiler would have found as when you
typedef a new type, the new type is not assignment compatabile with the
type used to make it up. C should only be so featureful.)