History log of /freebsd-10.1-release/sbin/dhclient/
Revision Date Author Comments
272461 03-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


270385 23-Aug-2014 ngie

MFC r270118:

Add LIBUTIL to DPADD

This will fix "make checkdpadd"

PR: 192759
Approved by: rpaulo (mentor)
Phabric: D623


264996 27-Apr-2014 jmmv

MFC various moves of tools/regressions/ tests to the new infrastructure.

- r263220 Migrate tools/regression/sbin/ to the new tests layout.
- r263222 Add Makefile missed in r263220.
- r263226 Migrate tools/regression/{usr.bin/lastcomm,usr.sbin}/ to the new tests layout.
- r263227 Migrate most of tools/regression/usr.bin/ to the new tests layout.
- r263345 Expand tabs that sneaked in into spaces.
- r263346 Migrate tools/regression/usr.bin/make/ to the new tests layout.
- r263348 Add Makefiles missed in r263346.
- r263351 Migrate tools/regression/usr.bin/pkill/ to the new tests layout.
- r263388 Mark multi_test as requiring /usr/share/dict/words.
- r263814 Fix path to the run.pl script to let these tests run.
- r264742 Prevent building tests when bootstrapping make.

This is 'make tinderbox' clean.


261828 13-Feb-2014 brueffer

MFC: r261566

Use CAP_EVENT instead of the deprecated CAP_POLL_EVENT.

PR: 185382 (based on)
Submitted by: Loganaden Velvindron
Reviewed by: pjd


256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


255219 05-Sep-2013 pjd

Change the cap_rights_t type from uint64_t to a structure that we can extend
in the future in a backward compatible (API and ABI) way.

The cap_rights_t represents capability rights. We used to use one bit to
represent one right, but we are running out of spare bits. Currently the new
structure provides place for 114 rights (so 50 more than the previous
cap_rights_t), but it is possible to grow the structure to hold at least 285
rights, although we can make it even larger if 285 rights won't be enough.

The structure definition looks like this:

struct cap_rights {
uint64_t cr_rights[CAP_RIGHTS_VERSION + 2];
};

The initial CAP_RIGHTS_VERSION is 0.

The top two bits in the first element of the cr_rights[] array contain total
number of elements in the array - 2. This means if those two bits are equal to
0, we have 2 array elements.

The top two bits in all remaining array elements should be 0.
The next five bits in all array elements contain array index. Only one bit is
used and bit position in this five-bits range defines array index. This means
there can be at most five array elements in the future.

To define new right the CAPRIGHT() macro must be used. The macro takes two
arguments - an array index and a bit to set, eg.

#define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL)

We still support aliases that combine few rights, but the rights have to belong
to the same array element, eg:

#define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL)
#define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL)

#define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP)

There is new API to manage the new cap_rights_t structure:

cap_rights_t *cap_rights_init(cap_rights_t *rights, ...);
void cap_rights_set(cap_rights_t *rights, ...);
void cap_rights_clear(cap_rights_t *rights, ...);
bool cap_rights_is_set(const cap_rights_t *rights, ...);

bool cap_rights_is_valid(const cap_rights_t *rights);
void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src);
void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src);
bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little);

Capability rights to the cap_rights_init(), cap_rights_set(),
cap_rights_clear() and cap_rights_is_set() functions are provided by
separating them with commas, eg:

cap_rights_t rights;

cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT);

There is no need to terminate the list of rights, as those functions are
actually macros that take care of the termination, eg:

#define cap_rights_set(rights, ...) \
__cap_rights_set((rights), __VA_ARGS__, 0ULL)
void __cap_rights_set(cap_rights_t *rights, ...);

Thanks to using one bit as an array index we can assert in those functions that
there are no two rights belonging to different array elements provided
together. For example this is illegal and will be detected, because CAP_LOOKUP
belongs to element 0 and CAP_PDKILL to element 1:

cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL);

Providing several rights that belongs to the same array's element this way is
correct, but is not advised. It should only be used for aliases definition.

This commit also breaks compatibility with some existing Capsicum system calls,
but I see no other way to do that. This should be fine as Capsicum is still
experimental and this change is not going to 9.x.

Sponsored by: The FreeBSD Foundation


252697 04-Jul-2013 pjd

Fix dhclient for interfaces that are down. The discover_interfaces() function
that looks for interface skips interfaces that are not UP. We need to call
dhclient-script PREINIT before we call discover_interfaces(), so the script has
a chance to bring the interface UP.

Reported by: alfred


252634 03-Jul-2013 pjd

MFp4 @229488:

Sandbox unprivileged process using capability mode.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252633 03-Jul-2013 pjd

MFp4 @229487:

Revoke all capability rights from STDIN and allow only for write to STDOUT and
STDERR. All those descriptors are redirected to /dev/null.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252632 03-Jul-2013 pjd

MFp4 @229486:

Once PID is written to the pidfile, revoke all capability rights.
We just want to keep the pidfile open.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252631 03-Jul-2013 pjd

MFp4 @229485:

Only allow to overwrite lease file.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252630 03-Jul-2013 pjd

MFp4 @229484:

Limit routing socket so only poll(2) and read(2) are allowed (CAP_POLL_EVENT
and CAP_READ). This prevents unprivileged process from adding, removing or
modifying system routes.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252629 03-Jul-2013 pjd

MFp4 @229483:

Limit communication pipe with privileged process to CAP_READ and CAP_WRITE.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252628 03-Jul-2013 pjd

MFp4 @229482:

- Limit bpf descriptor in unprivileged process to CAP_POLL_EVENT, CAP_READ and
allow for SIOCGIFFLAGS, SIOCGIFMEDIA ioctls.
- While here limit bpf descriptor in privileged process to only CAP_WRITE.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252626 03-Jul-2013 pjd

MFp4 @229481:

Currently it was allowed to send any UDP packets from unprivileged process and
possibly any packets because /dev/bpf was open for writing.

Move sending packets to privileged process. Unprivileged process has no longer
access to not connected UDP socket and has only access to /dev/bpf in read-only
mode.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252625 03-Jul-2013 pjd

MFp4 @229480:

Shutdown write direction of the routing socket. We only need to read from it.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252624 03-Jul-2013 pjd

MFp4 @229479:

- Add new request (IMSG_SEND_PACKET) that will be handled by privileged process.
- Add $FreeBSD$.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252623 03-Jul-2013 pjd

MFp4 @229477:

The gethostname(3) function won't work in capability mode, because reading
kern.hostname sysctl is not permitted there. Cache hostname early and use
cached value later.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252621 03-Jul-2013 pjd

Remove redundant white-spaces.


252620 03-Jul-2013 pjd

MFp4 @229476,229478:

Make use of two fields: rfdesc and wfdesc to keep bpf descriptor open for
reading only in rfdesc and bpf descriptor open for writing only in wfdesc.
In the end they will be used by two different processes.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252619 03-Jul-2013 pjd

MFp4 @229474:

iov_base field is 'void *' in FreeBSD, no need to cast.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252618 03-Jul-2013 pjd

MFp4 @229473:

No caller checks send_packet() return value, so make it void.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252616 03-Jul-2013 pjd

MFp4 @229472:

Use the same type for 'from' and 'to' argument in send_packet().

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252615 03-Jul-2013 pjd

MFp4 @229471:

Remove unused argument from assemble_hw_header().

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252614 03-Jul-2013 pjd

MFp4 @229470:

Remove unused argument from send_packet().

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252612 03-Jul-2013 pjd

MFp4: @229469:

Garbage-collect dead prototypes.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation


252506 02-Jul-2013 bms

When acquiring a lease, record the value of the BOOTP siaddr field
contained in the DHCP offer, and write it out to the lease file
as an unquoted value of the "next-server" keyword. The value is ignored
when the lease is read back by dhclient, however other applications
are free to parse it.

The intent behind this change is to allow easier interoperability
with automated installation systems e.g. Cobbler, Foreman, Razor;
FreeBSD installation kernels can automatically probe the network
to discover deployment servers. There are no plans to MFC this
change unless a backport is specifically requested.

The syntax of the "next-server <ip>" lease keyword is intended to be
identical to that used by the ISC DHCPD server in its configuration files.
The required defines are already present in dhclient but were unused before
this change. (Note: This is NOT the same as Option 66, tftp-server-name).

It has been exercised in a university protocol testbed environment, with
Cobbler and an mfsBSD image containing pc-sysinstall (driven by Cobbler
Cheetah templates). The SYSLINUX memdisk driver is used to boot mfsBSD.
Currently this approach requires that a dedicated system profile has
been created for the node where FreeBSD is to be deployed. If this
is not present, the pc-sysinstall wrapper will be unable to obtain
a node configuration. There is code in progress to allow mfsBSD images
to obtain the required hints from the memdisk environment by parsing
the MBFT ACPI chunk. This is non-standard as it is not linked into
the platform's ACPI RSDT.

Reviewed by: des


249766 22-Apr-2013 jhb

Use a higher TTL (128) for DHCP packets. This matches the ISC DHCP client.

PR: bin/170279
MFC after: 1 week


239564 22-Aug-2012 jhb

Revert r239356 and use an alternate algorithm.

First, don't exit when the link goes down on an interface. Instead,
teach dhclient to track changes in link state and to enter the reboot
state when the link on an interface goes up causing dhclient to attempt
to renew its existing lease.

Second, remove the change I added to clear the old lease when dhclient
exits due to an error (such as ifconfig down). If an interface is
using autoconfiguration it should keep its autoconfiguration as much as
possible. If the next time it needs a configuration it is able to reuse
the previous autoconfiguration, then leaving the settings intact allows
existing connections to survive temporary outages, etc.

PR: bin/166656
MFC after: 1 month


239356 17-Aug-2012 jhb

Fix dhclient to properly exit and teardown the configured lease when
link is lost. devd will start a new dhclient instance when link is
restored.

PR: bin/166656
Submitted by: Peter Jeremy (mostly)
Reviewed by: brooks (earlier version from Peter)
MFC after: 1 month


229778 07-Jan-2012 uqs

Spelling fixes for sbin/


229002 30-Dec-2011 dumbbell

Set svn:executable on dhclient-script

Sponsored by: Yakaz (http://www.yakaz.com)


229000 30-Dec-2011 dumbbell

Invalid Domain Search option isn't considered as a fatal error

In the original Domain Search option patch, an invalid option value
would cause the whole lease to be rejected. However, DHCP servers who
emit such an invalid value are more common than I thought. With this new
patch, just the option is rejected, not the entire lease.

PR: bin/163431
Submitted by: Fabian Keil <fk@fabiankeil.de> (earlier version)
Reviewed by: Fabian Keil <fk@fabiankeil.de>
Sponsored by: Yakaz (http://www.yakaz.com)


228615 17-Dec-2011 dim

In sbin/dhclient, since we know the size of the source strings anyway,
we might as well use memcpy; strlcpy is really unnecessary here.

MFC after: 1 week


228614 17-Dec-2011 dim

In sbin/dhclient, work around warnings about the size argument to
strlcpy appearing to be the size of the source buffer, instead of the
destination.

MFC after: 1 week


228463 13-Dec-2011 glebius

dhclient-script relied on incorrect behavior of SIOCAIFADDR ioctl,
that changed 0.0.0.0/0.0.0.0 prefix to 0.0.0.0/255.0.0.0.

In the r228313 this behavior was fixed, and since dhclient-script
got broken.

I'm not sure this fix is a perfect one, it just changes
dhclient-script to set 0.0.0.0/255.0.0.0 explicitly.

PR: kern/163206


228259 04-Dec-2011 dumbbell

Support domain-search in dhclient(8)

The "domain-search" option (option 119) allows a DHCP server to publish
a list of implicit domain suffixes used during name lookup. This option
is described in RFC 3397.

For instance, if the domain-search option says:
".example.org .example.com"
and one wants to resolve "foobar", the resolver will try:
1. "foobar.example.org"
2. "foobar.example.com"

The file /etc/resolv.conf is updated with a "search" directive if the
DHCP server provides "domain-search".

A regression test suite is included in this patch under
tools/regression/sbin/dhclient.

PR: bin/151940
Sponsored by Yakaz (http://www.yakaz.com)


226345 13-Oct-2011 des

Make dhclient use a pid file. Modify the rc script accordingly; while
there, clean it up and add some error checks.

Glanced at by: brooks@
MFC after: 3 weeks


219739 18-Mar-2011 ume

Use resolvconf(8) to update /etc/resolv.conf.
If you don't want to use resolvconf(8) to update /etc/resolv.conf,
you can put resolvconf_enable="NO" into /etc/dhclient-enter-hooks.


212253 06-Sep-2010 brian

Document dhclient-enter-hooks and dhclient-exit-hooks and mention
how to configure dhclient to clear the interface of IP numbers prior
to configuring it.

PR: 149351
MFC after: 2 weeks


209756 07-Jul-2010 brian

When dhclient obtains a lease, it runs dhclient-script and expects
it to configure the interface. When the script is complete, dhclient
monitors the routing socket and will terminate if its address is
deleted or if its interface is removed or brought down.

Because the routing socket is already open when dhclient-script is
run, dhclient ignores address deletions for 10 seconds after the
script was run.

If the address that will be obtained is already configured on the
interface before dhclient starts, and if dhclient-script takes more
than 10 seconds (perhaps due to dhclient-*-hooks latencies), on script
completion, dhclient will immediately and silently exit when it sees
the RTM_DELADDR routing message resulting from the script reassigning
the address to the interface.

This change logs dhclient's reason for exiting and also changes the
10 second timeout to be effective from completion of dhclient-script
rather than from when it was started.

We now ignore RTM_DELADDR and RTM_NEWADDR messages when the message
contains no interface address (which should not happen) rather than
exiting.

Not reviewed by: brooks (timeout)
MFC after: 3 weeks


198352 21-Oct-2009 philip

Make dhclient use bootpc (68) as the source port for unicast DHCPREQUEST
packets instead of allowing the protocol stack to pick a random source port.

This fixes the behaviour where dhclient would never transition from RENEWING
to BOUND without going through REBINDING in networks which are paranoid about
DHCP spoofing, such as most mainstream cable-broadband ISP networks.

Reviewed by: brooks
Obtained from: OpenBSD (partly - I'm not convinced their solution can work)
MFC after: 1 week (pending re approval)


198236 19-Oct-2009 ru

Switch the default WARNS level for sbin/ to 6.

Submitted by: Ulrich Spörlein


195805 21-Jul-2009 sam

Fix the logic to count the number of "live interfaces". With this change
dhclient now terminates when the underlying ifnet is destroyed (e.g.
on card eject).

Reviewed by: brooks
Approved by: re (kib)


193765 08-Jun-2009 brian

Fix an off by one error when we limit append/prepend text sizes based on our
internal buffer sizes.

When we 'append', assume we're appending to text. Some MS dhcp servers will
give us a string with the length including the trailing NUL. when we 'append
domain-name', we get something like "search x.y\000 z" in resolv.conf :(

MFC after: 1 week
Security: A buffer overflow (by one NUL byte) was possible.


183974 17-Oct-2008 brooks

Support the remaining options listed in dhcp-options(5) and RFC 2132.

PR: bin/127076
Submitted by: jkim
MFC after: 1 week


180130 30-Jun-2008 ed

Run the privileged dhclient process in its own session.

In the MPSAFE TTY branch, I noticed PTY's to be leaked, because
dhclient's privileged process was run inside the session of, say, the
login shell. Make sure we call setsid() here.

Approved by: philip (mentor), brooks


179689 09-Jun-2008 brooks

Use the -n flag to route(8) when calling "route get". Otherwise we hang
for a long time if we get a lease, but DNS isn't working.

MFC after: 1 week


178232 15-Apr-2008 brooks

When sending packets directly to the DHCP server, use a socket and send
directly rather than bogusly sending it out as a link layer broadcast
(which fails to be received on some networks).

PR: bin/96018
MFC after: 2 weeks


177730 30-Mar-2008 brooks

Add a new function is_default_interface() which determines if this
interface is one with the default route (or there isn't one). Use it to
decide if we should adjust the default route and /etc/resolv.conf.

Fix the delete of the default route. The if statement was totally bogus
and the delete only worked due to a typo. [1]

Reported by: Jordan Coleman <jordan at JordanColeman dot com> [1]
MFC after: 1 week


177501 22-Mar-2008 sam

Defer state change on disassociate to avoid unnecessarily dropping the
lease: track the current bssid and if it changes (as reported in an
assoc/reassoc) event only then kick the state machine. This gives us
immediate response when roaming but otherwise causes us to fallback on
the normal state machine.

Reviewed by: brooks, jhb
MFC after: 3 weeks


177500 22-Mar-2008 sam

correct syslog mask so LOG_DEBUG msgs are not lost

MFC after: 2 weeks


175554 21-Jan-2008 brooks

During PREINIT, when giving the interface the address 0.0.0.0, do it as an
alias to avoid distrubing other addresses.

PR: bin/119255
Submitted by: Jaakko Heinonen <jh at saunalahti dot fi>


174314 05-Dec-2007 jkim

Teach dhclient(8) about net80211 link (association) status.

Reviewed by: brooks
MFC after: 3 days


172252 20-Sep-2007 gabor

- Remove references to unexisting man pages

PR: docs/116099
Submitted by: Ben Kaduk <minimarmot@gmail.com>
Approved by: re (bmah)
MFC after: 3 days


171187 03-Jul-2007 thompsa

Use the -n flag on ifconfig so that dhclient does not cause the kernel module
to be reloaded when the interface is torn down.

Reviewed by: brooks
Approved by: re (kensmith)


168689 13-Apr-2007 emaste

The minimum size of an RFC3442 destination descriptor is five bytes, so
correct test to -ge 5. Without this change an RFC3442 encoded default
route would be ignored.

Reported by: Cedric Jonas <cedric at decemplex dot net>


166602 09-Feb-2007 emaste

Implement RFC3442, the Classless Static Route option.

The original DHCP specification includes a route option but it supports
only class-based routes. RFC3442 adds support for specifying the netmask
width for each static route. A variable length encoding is used to minimize
the size of this option.

PR: bin/99534
Submitted by: Andrey V. Elsukov <bu7cher@yandex.ru>
Reviewed by: brooks


166597 09-Feb-2007 emaste

Add a $FreeBSD$ tag missing after the original import. Note that this
file isn't actually installed; the one in src/etc is.


166330 29-Jan-2007 brooks

Actually implement rev 1.12 for host names and NIS domain names. We
were removing the invalid option, but still rejecting the lease.

Reported by: Yoshihiko Sarumaru <mistral at imasy dot or dot jp>


162641 26-Sep-2006 brooks

It is possible for bpf to return a length such that:

length != BPF_WORDALIGN(length)

This meeans that it is possible for this to be true:

interface->rbuf_offset > interface->rbuf_len

Handle this case in the test for running out of packets. While
OpenBSD's solution of setting interface->rbuf_len to
BPF_WORDALIGN(length) is safe due to the size of the buffer, I think
this solution results in less hidden assumptions.

This should fix the problem of dhclient running away and consuming 100%
CPU.

PR: bin/102226
Submitted by: Joost Bekkers <joost at jodocus.org>
MFC after: 3 days


161514 21-Aug-2006 brian

Revert the addition of -p. It's flawed in that dhclient should not run
on an interface without carrier. devd should be used instead to handle
link up/down events.

Put on the right path by: brooks, sam


161417 17-Aug-2006 brian

Bump the document date. s/dhclient/.Nm/

Suggested by: ru


161411 17-Aug-2006 brian

Correct usage()


161410 17-Aug-2006 brian

Add a -p switch to dhclient. The switch tells dhclient to persist
despite the interface link status.

Add dhclient_flags_iface and background_dhclient_iface rc.conf options.
(where iface is a specific interface). These can be used to give
interface specific flags to dhclient.

Reviewed by: brooks@


160089 03-Jul-2006 jkim

Send client identifier unconditionally. My ancient D-Link router response
with NACK if I don't set it. Setting 'option dhcp-client-identifier' is
alternative but it is inconvenient because I have to keep the list of
all MAC addresses. As bin/94743 pointed out, it is always sent from
Windows clients and I found Mac OS X does the same.

OK'd by: brooks


158856 23-May-2006 imp

Remove 'n' from the getopt string. There's no -n option that is
parsed, so it winds up at usage anyway.

Add 'b' to the usage summary. Noticed by Ben Mesander.


158353 07-May-2006 brooks

Be more like Windows and Linux and send our hostname in the host-name
option if none is given in the config file. Also add #ifdefd out
support for sending a client ID based on our MAC address.

PR: bin/94743, bin/76401
Submitted by: Frank Behrens <frank at pinky dot sax dot de>
X-MFC after: 6.1-RELEASE


155394 06-Feb-2006 jcamou

Correct RFC for NTP.

PR: docs/92629
Submitted by: Daniel Gerzo <danger@rulez.sk>
Noticed by: Michal F. Hanula <f@7f000001.org>
Approved by: trhodes (mentor)


154869 26-Jan-2006 brooks

Fix rev 1.12.

/tmp may not be writeable yet when dhclient is first run via
/etc/rc.d/netif so using it may not work. Also, writing to a
predictable file in /tmp as root is a really bad idea since a malicious
user may be able to win a race and insert a symlink which will allow
them to cause any file to be overwritten. To solve these problems,
create the tempory file in /var/run which will exist this early and is
writable only by root.

Security: Local risk if users can cause dhclient to run on demand
(such as by unplugging and replugging the network cable).


154760 24-Jan-2006 brooks

Give the TIMEOUT case a chance to work by using -t # instead of the
OpenBSD -w # when invoking ping.

PR: bin/92187
Submitted by: "Shin'ya Kumabuchi" <kumabu at t3 dot rim dot or dot jp>
MFC After: 6 days


154702 23-Jan-2006 wes

Make dhclient-script more agreeable with read-only /etc.

PR: 90518
Submitted by: John E. Hein <jhein@timing.com>
MFC after: 3 days


154165 10-Jan-2006 brooks

Mention the -b flag in the SYNOPSIS.

MFC after: 1 week


154164 10-Jan-2006 brooks

When we give up on an interface, use the arp(8) command to remove all
entries from the interface rather than using ifconfig's delete command.
This preserves non-dhclient configured addresses (though they are wiped
out when dhclient is restarted).

MFC after: 1 week


154161 10-Jan-2006 brooks

Allow users to add aliases to the interface.

PR: bin/87465 (different solution used)
MFC after: 1 week


153287 10-Dec-2005 brooks

When we get a bogus hostname in an option, drop the option rather than
refusing the lease. This allow obtaining leases on misadministered
networks that use host names with underscores in them.

MFC After: 3 days


149898 08-Sep-2005 brooks

Avoid updating resolv.conf when no changes have actually occured.

Submitted by: ume


149896 08-Sep-2005 brooks

When we fail to aquire a lease, our lease expires without a sucessful
renewal, or we lose link, be more forceful about clearing interface
state so another interface that connects to the same network has a
chance of working. This doesn't address attemping to connect to both at
once, but appears to allow unplugging from a wired interface and then
inserting a wireless card that associates with an AP bridged to the same
LAN.


149727 02-Sep-2005 brooks

When we supersed the subnet-mask, write the forced value to the lease
file. This is what the ISC client does.

Submitted by: Rostislav Krasny <rosti dot bsd at gmail dot com>


149639 30-Aug-2005 brooks

Introduce a new helper function check_search() derived for res_hnok to
check the domain-name parameter according to the rules for "search"
strings as documented in resolv.conf(5). Specifically, the string must
be no more than 256 bytes long and contain no more than six valid domain
names separated by white space.

The previous unchecked values could result in a mangled resolv.conf
file which could effectively deny access to local sites. This is not
a security issue as rogue dhcp servers could already do this without
sending invalid strings.

Reviewed by: cperciva
MFC After: 3 days


149519 26-Aug-2005 brooks

The $medium string often contains quoted values with spaces in them (ssids,
for example). Follow the example of the ISC script and wrap ifconfig
calls using $medium in eval "..." so this works.

Reported by: iedowse


149481 26-Aug-2005 brooks

In read_string(), when the last character was a backslash, unincrement
the output index instead of keeping what ever trash was in the buffer.

Reported by: iedowse


149480 26-Aug-2005 brooks

Use a more robust, grep-free command to get the interface of the current
default route.

Submitted by: Rostislav Krasny <rosti dot bsd at gmail dot com>


149479 26-Aug-2005 brooks

Don't and/remove a route to our assigned IP through 127.0.0.1. It
serves no apparent purpose (we commented this out ages ago in the ISC
scripts) and cases problems with some ADSL setups.

Reported by: Rostislav Krasny <rosti dot bsd at gmail dot com>


149400 24-Aug-2005 brooks

MFOpenBSD rev 1.9: fix a buffer overflow when processing config file
lines that are exactly 81 characters in length.

Obtained from: OpenBSD
MFC After: 3 days


149399 23-Aug-2005 brooks

Add __FBSDID to all .c files in dhclient to aid in determining file
versions when dealing with user problems.


149383 23-Aug-2005 csjp

FreeBSD unconditionally supports write filters now.


148484 28-Jul-2005 brooks

Further fix receive_packet() by using BPF_WORDALIGN to insure the offset
is properly aligned when we move to the next packet.

Obtained from: ISC dhclient via krw at OpenBSD


148465 28-Jul-2005 brooks

Don't reject packets with server names containing characters that are
not allowed in domain names. RFC 2132 does not list valid or invalid
characters and the ISC client accepts anything here.

Reported by: ps


148451 27-Jul-2005 brooks

Fix a bug in the handling of cases where we got a short (or zero)
capture. Zero length captures caused an infinte loop and short captures
probably caused memory corruption and a crash.

Reported by: many
MFC After: 3 days


148420 26-Jul-2005 brooks

s/if_defaulroute/if_defaultroute/

We may now handle route updates better.


148411 25-Jul-2005 brooks

Change host-name from type "X" to type "t". This allows the client to
accept NUL-terminated strings as required by RFC 2132.

This solution is not perfect as it removes the ability to send
NUL-terminated host-name options which may be required by some broken
servers. Given the current lack of an existance proof of such servers
and the fact that servers that send NUL-terminated domain names do
exist, this seems like an acceptable compromise. A discussion of these
issues can be found at:

http://marc.theaimsgroup.com/?l=dhcp-client&m=96837107208382&w=2

PR: bin/83468
Reported by: Sean Winn <sean at gothic dot net dot au>
MFC-after: 3 days


148373 25-Jul-2005 sam

treat REASSOC events just like ASSOC

MFC after: 3 days


148216 20-Jul-2005 marks

Bump document date.

Reminded by: ru


148214 20-Jul-2005 marks

Document -b flag of dhclient.

Reviewed by: ru
MFC after: 3 days


147689 30-Jun-2005 brooks

Don't complain when we receive smtp, pop, nntp, www, finger, and irc
server options.

Reported by: Max Boyarov <max_b at tut dot by>
Approved by: re (dhclient blanket)


147686 30-Jun-2005 brooks

People like to do RFC violating things with the domain-name option and
include a space seperated list of domains instead of the domain of the
host. This is supported on too many platforms to break for now so,
remove validation of this option for the moment.

The correct solution longer term is to implement RFC 3397 support and
then treat domain-name options containing space seperated lists of
domains as domain-search options for backwards compatability.

Approved by: re (dhclient blanket)


147596 25-Jun-2005 ru

Install the dhcp-options.5 manpage.

Timeout from: brooks
Approved by: re (blanket manpages)


147528 22-Jun-2005 ru

Line up the markup.

Approved by: re (blanket)


147351 13-Jun-2005 brooks

Avoid a null pointer dereference by not expiring our lease if we don't
have an active one.

Submitted by: sam
Reported by: James Snow <snow at teardrop dot org>
Approved by: re (dhclient blanket)


147218 10-Jun-2005 brooks

Add support for /etc/dhclient-enter-hooks to match /etc/dhclient-exit-hooks.


147138 08-Jun-2005 brooks

Add support for /etc/dhclient-exit-hooks file.

Tested by: Max Boyarov <max_b at tut dot by>


147106 07-Jun-2005 brooks

Fix build on 64-bit platforms where time_t is 64 bit. Since where
talking about time related to leases, it should be OK to cast these to
(int)s rather than using intmax_t.

Submitted by: ru
Pointy hat: brooks


147099 07-Jun-2005 ru

- Remove OpenBSD'ism (bsd.own.mk).
- Remove redundant and harmful -Wall from CFLAGS.


147087 07-Jun-2005 brooks

Use SCRIPTS to install dhclient-script instead of rolling our own.


147086 07-Jun-2005 brooks

FreeBSDize the dhclient-script.

Submitted by: sam


147085 07-Jun-2005 brooks

Define _PATH_VAREMPTY.

Add a -b option to background immediatly.

Add support for 802.11 routing messages to "instantly" renegotiate
at lease when we associate with a new network.

Submitted by: sam


147077 07-Jun-2005 brooks

NULL is not a valid time_t.

Submitted by: sam


147076 07-Jun-2005 brooks

We don't support BPF write filters at this time.

Submitted by: sam


147075 07-Jun-2005 brooks

Take the OpenBSD version of the Makefile to resolve conflicts as the old
one is irrelevent. Add $FreeBSD.


147073 07-Jun-2005 brooks

This commit was generated by cvs2svn to compensate for changes in r147072,
which included commits to RCS files with non-trunk default branches.


147071 07-Jun-2005 brooks

Remove the bits to build the isc-dhclient.


140941 28-Jan-2005 ru

Let bsd.prog.mk set SRCS and MAN to their default values.


139103 21-Dec-2004 ru

Start the dreaded NOFOO -> NO_FOO conversion.

OK'ed by: core


136910 24-Oct-2004 ru

For variables that are only checked with defined(), don't provide
any fake value.


126178 23-Feb-2004 johan

style.Makefile(5):
Use WARNS?= instead of WARNS=.


123070 30-Nov-2003 murray

Update maintainer line. mbr has been maintainer for at least the last
6 months.

Approved by: re (murray)


118702 09-Aug-2003 mbr

Turn the annoying and long error message off. It was so
long that it was even hard to find the real error cause.

Requested by: rwatson


118110 28-Jul-2003 mbr

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


117036 29-Jun-2003 gordon

Tweak a couple of utilities so they compile cleanly for /rescue. Mostly
path fixes.

Submitted by: Tim Kientzle <kientzle@acm.org>


112584 25-Mar-2003 mdodd

Hook omshell(1) up to the build.


112583 25-Mar-2003 mdodd

Building crunched things by hand (regenerating boot floppies for example)
without a full make release cycle fails as the correct include path
isn't setup.


96513 13-May-2002 ru

Removed now unused INTERNALSTATICLIB.
INTERNALLIB now implies NOPIC and NOPROFILE.
Removed gratuitous NOMAN.


94629 13-Apr-2002 obrien

Do not use perl where sed is more than adequate.


91490 28-Feb-2002 matusita

Fix "make release.4" breakage.

src/contrib/isc-dhcp/includes/minires/resolv.h has a 'extern' definition
but it makes an error when linking crunched binary just like this:

dhclient.lo: In function `MRres_nquery':
dhclient.lo(.text+0x2dcce): undefined reference to `__h_errno_set'
dhclient.lo(.text+0x2dd5b): undefined reference to `__h_errno_set'
dhclient.lo: In function `MRres_nquerydomain':
dhclient.lo(.text+0x2de53): undefined reference to `__h_errno_set'

The author understands this will be a problem (see comments in resolv.h).
Murray said that the author will fix this, but as a temporary solution,
modifying the source code and not to use __h_errno_set.

BTW, I'm sorry that previous commitlog in src/sbin/dhclient/Makefile should
read "Found by:" instead of "Confirmed by"; I just found that rev 1.15
has a typo so fixed.

Tested on: ushi.jp.FreeBSD.org with today's 5-current source code.
(belive me, "make release.4" works fine now)


91450 28-Feb-2002 matusita

For unbraking "make release": s/client/common/g
(these files are sitting in src/contrib/isc-dhcp/common, not .../client.)

Confirmed by: 5.0-CURRENT-20020228-JPSNAP at snapshots.jp.FreeBSD.org


91306 26-Feb-2002 murray

Add some ifdef(RELEASE_CRUNCH) goo to explicitly list the requisite
object files for crunchgen. Without this patch, release.4 will fail
to build the crunched binaries for the release floppies.


90954 20-Feb-2002 obrien

Neutralize bits of ns_parse.c with bad juju.


90940 19-Feb-2002 obrien

Style cleanup.

Approved by: Murray


90922 19-Feb-2002 murray

Makefile glue for DHCP v3 import.


90080 01-Feb-2002 alfred

If the dhcpd server doesn't provide a domain name or dns servers then
don't clobber /etc/resolv.conf

Add $FreeBSD.

Submitted by: an j. peterson" <rbw@myplace.org>
Verified fix in: dhcp-3.0.1rc6
PR: misc/34455


87325 04-Dec-2001 obrien

Default to WARNS=2.
Binary builds that cannot handle this must explicitly set WARNS=0.

Reviewed by: mike


75286 07-Apr-2001 ru

beforeinstall -> SCRIPTS.


74815 26-Mar-2001 ru

- Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.


65532 06-Sep-2000 nectar

Add nsswitch support. By creating an /etc/nsswitch.conf file, you can
configure FreeBSD so that various databases such as passwd and group can be
looked up using flat files, NIS, or Hesiod.

= Hesiod has been added to libc (see hesiod(3)).

= A library routine for parsing nsswitch.conf and invoking callback
functions as specified has been added to libc (see nsdispatch(3)).

= The following C library functions have been modified to use nsdispatch:
. getgrent, getgrnam, getgrgid
. getpwent, getpwnam, getpwuid
. getusershell
. getaddrinfo
. gethostbyname, gethostbyname2, gethostbyaddr
. getnetbyname, getnetbyaddr
. getipnodebyname, getipnodebyaddr, getnodebyname, getnodebyaddr

= host.conf has been removed from src/etc. rc.network has been modified
to warn that host.conf is no longer used at boot time. In addition, if
there is a host.conf but no nsswitch.conf, the latter is created at boot
time from the former.

Obtained from: NetBSD


63926 27-Jul-2000 obrien

This commit was generated by cvs2svn to compensate for changes in r63925,
which included commits to RCS files with non-trunk default branches.


63732 21-Jul-2000 obrien

Blah, need to add /usr/bin to the path also.
Of course this is a bug in that the dhclient script will not work properly
if one has a local / and an NFS mounted /usr and needs to obtain its IP
address via DHCP before being able to mount /usr.


63633 20-Jul-2000 obrien

Need /usr/sbin for arp(8).


63630 20-Jul-2000 obrien

Patchlevel 3 of the ISC 2.0 dhcp client now requires us to give it the
shell script's PATH setting in the environment.


50476 28-Aug-1999 peter

$Id$ -> $FreeBSD$


48174 24-Jun-1999 obrien

Add new file that needs compiling.


45259 03-Apr-1999 bde

Install dhclient-script under ${DESTDIR}.

PR: 10615, 10891


44120 18-Feb-1999 obrien

More style fixes to bring this almost to bde's suggested version.


44113 18-Feb-1999 obrien

bde suggests not to trust ${COPY} to always be defined.
also fix style bugs submitted by Bruce


43856 10-Feb-1999 obrien

This commit was generated by cvs2svn to compensate for changes in r43855,
which included commits to RCS files with non-trunk default branches.