Commit Graph

43 Commits

Author SHA1 Message Date
mbr
c3371ccc62 Make 'client DNS forward update' working again which got broken in rev.
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
2004-08-16 22:35:56 +00:00
mbr
c2d030ed89 Recommit removed Rev. 1.40. This fix does solve a FPE with negative lease
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
2004-08-16 21:26:04 +00:00
mbr
d877ffb047 It could happen that the renew/rebind times in the leasefile were
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>
2004-08-16 16:09:50 +00:00
mbr
9cbc7c3e68 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.
2004-08-16 15:48:02 +00:00
mbr
7a3bb5bd7e Resolve conflicts from dhclient 3.0.1 final import.
No functional changes in this import.
2004-08-15 23:37:10 +00:00
des
7c905c6c6c Fix a number of incorrect assumptions regarding the size of time_t.
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
2004-07-06 15:15:14 +00:00
mbr
4e40f399fe Resolve conflicts. 2004-06-26 10:37:42 +00:00
mbr
67b460e517 Dhclient dumps core on suspend/resume cycles. If the client isn't active
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>
2004-01-25 11:30:50 +00:00
mbr
43a6cd5e20 If we have a working link again after connectivity loss, or if we need
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.
2004-01-19 22:07:59 +00:00
mbr
30c9dcd76d Resolve conflicts:
* rev. 1.33/1.25
2003-09-02 11:09:45 +00:00
mbr
089f3c60d4 Sync with ISC repo. Use SIGTERM instead of SIGKILL, make oldpid a long and
cast it into a pid_t.
2003-09-02 09:09:53 +00:00
mbr
b8e0369153 Change name of state_link() to state_polling() to make it
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
2003-08-10 22:01:37 +00:00
mbr
f318bbf9d2 Fix devices which do not support ifm_status. Always return
TRUE for them.

Reported by:	mdodd
Tested by:	Craig Rodrigues <rodrigc@crodrigues.org>
2003-08-09 20:44:08 +00:00
mbr
61ffd164eb Do not poll during discover. Add a polling tunable to the interface
struct to be able to turn polling on/off.

Tested by:	Larry Rosenman <ler@lerctr.org>
2003-08-07 14:58:46 +00:00
mbr
4f4415b6cd - Fix the polling code to work with media settings in dhclient.conf.
- 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
2003-08-07 07:27:14 +00:00
mbr
ff9091aff7 Change ieee802 to ieee80211.
Add bogospaces to match the ISC style.

Suggested by:	eivind
2003-08-06 15:19:52 +00:00
mbr
df37a5270c Don't wait forever if there is no link, go to background
after 2 x polling time.
2003-07-28 13:25:04 +00:00
mbr
6416064bd6 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
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
2003-07-28 08:30:11 +00:00
mbr
c1f83c0cff We don't have cat(1) and kill(1) on the miniroot disks.
This fix will be committed to the ISC repo later, but for now
take this file out of the vendor tree.

Reviewed by:	phk
Approved by:	murray
2003-03-23 23:29:36 +00:00
obrien
501b002069 Add a -v(erbose) flag to undo our -q(uiet) default. 2003-03-18 19:46:55 +00:00
murray
82de6974f1 Resolve conflicts.
(import approved by: re)
2003-01-15 10:44:05 +00:00
murray
feb7c19b69 Resolve conflicts. 2002-09-30 08:45:34 +00:00
murray
dbb6941311 Resolve conflicts:
* $FreeBSD$
  * connect std{in,out,err} (r1.19).
  * prefer strlcpy to strpy (r1.13).
  * quiet by default (r1.6).
  * document -D option.
2002-04-01 08:02:18 +00:00
murray
5f083a97c7 Resolve conflicts.
* $FreeBSD$
  * connect std{in,out,err}. (r1.19)
  * prefer strlcpy to strpy. (r1.13)
  * quiet by default. (r1.6)
  * document -D option.
2002-02-19 12:04:29 +00:00
obrien
facc2592c2 Connect std{in,out,err} to *something* so that "hooks" scripts that write
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
2001-07-16 01:56:48 +00:00
obrien
fc00659ff5 Fix conflicts. 2000-11-04 19:59:11 +00:00
obrien
6a1679ea16 Fix conflicts. 2000-08-09 18:38:26 +00:00
obrien
982ec76a86 Fix vendor bogon where one of dhcp_option_ev_name()'s formal parameter
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.)
2000-07-20 19:51:37 +00:00
obrien
0028a37058 Make sure we delete the PID file when we exit.
Obtained from:	OpenBSD rev 1.3 (this semi-security fix was hidden as a
                                 lease time fix)
2000-07-20 09:33:24 +00:00
obrien
d19be973db Add yet more options to usage() that the author did not document. 2000-07-20 09:16:30 +00:00
obrien
93bac0087e Careful with long, command-line provided interface names.
Obtained from:	OpenBSD (rev 1.7)
2000-07-20 08:57:29 +00:00
obrien
e71f7e5411 Fix conflicts. 2000-07-20 08:44:53 +00:00
obrien
845833effb Removed the doubled $FreeBSD$. 2000-06-26 23:02:56 +00:00
obrien
b0ef5eef54 Merge in rev 1.2 ("-1"), and rev 1.6 (be quiet). 2000-06-26 08:21:15 +00:00
obrien
2d6635330f Fix -1 (onetry) fails, exit(2) rather than exit(1) so an error from this
option is distingishable from other errors.
1999-06-25 22:28:34 +00:00
obrien
9cddb41c75 Clean up conflicts. 1999-06-24 04:38:03 +00:00
obrien
d67781f126 Fix conflicts. 1999-05-02 09:24:16 +00:00
obrien
9a038f7924 Be quiet by default. 1999-04-02 17:19:19 +00:00
obrien
7395a30f20 fix conflicts. 1999-03-22 01:29:39 +00:00
obrien
95711e23bb fix conflicts 1999-02-28 20:44:08 +00:00
obrien
e09462d4aa fix conflicts 1999-02-11 12:49:40 +00:00
obrien
436c49a681 add -1 option: Try once, if we fail, EXIT
Obtained from:	OpenBSD
1999-02-10 23:51:25 +00:00
obrien
117fbe9a9b Virgin import of ISC-DHCP v2.0b1pl6 1999-02-10 09:10:13 +00:00