History log of /src/sbin/dhclient/dispatch.c (Results 1 – 25 of 87)
Revision Date Author Comments
# 43d19e6a 08-Apr-2025 Colin Percival <cperciva@FreeBSD.org>

dhclient: Keep two clocks

Until July 2024, dhclient kept track of time as seconds-since-epoch as
a time_t. This was a problem because (a) we wanted sub-second timeouts
and (b) timeouts didn't alway

dhclient: Keep two clocks

Until July 2024, dhclient kept track of time as seconds-since-epoch as
a time_t. This was a problem because (a) we wanted sub-second timeouts
and (b) timeouts didn't always do the right thing if the system clock
changed.

Switching to using CLOCK_MONOTONIC and struct timespec fixed those
issues but introduced a new problem: CLOCK_MONOTONIC values were being
intepreted as seconds-since-epoch and written to the dhclient.leases
file, causing confusion with DHCP leases expiring in early 1970.

Attempt to compromise between these by keeping track of both times;
any type within dhclient which is a time_t now refers to seconds past
the epoch, while any struct timespec value is a CLOCK_MONOTONIC time.

PR: 283256
Reviewed by: dch
Fixes: f0a38976b01e ("dhclient: Use clock_gettime() instead of time()")
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D49720

show more ...


# f0a38976 08-Jul-2024 Isaac Cilia Attard <icattard@FreeBSD.org>

dhclient: Use clock_gettime() instead of time()

Change the use of time() to clock_gettime() to have millisecond-accurate
rather than second-accurate timeouts.

Sponsored by: Google LLC (GSoC 2024)
S

dhclient: Use clock_gettime() instead of time()

Change the use of time() to clock_gettime() to have millisecond-accurate
rather than second-accurate timeouts.

Sponsored by: Google LLC (GSoC 2024)
Signed-off-by: Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after: 10 days
Reviwed by: cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request: https://github.com/freebsd/freebsd-src/pull/1368

show more ...


# 76e0ffd9 08-Jul-2024 Isaac Cilia Attard <icattard@FreeBSD.org>

dhclient: Timeouts for entering state_selecting

Use the new add_timeout_timespec() API to handle timeouts for
state_selecting within dhclient.c. No functional change intended.

Sponsored by: Google

dhclient: Timeouts for entering state_selecting

Use the new add_timeout_timespec() API to handle timeouts for
state_selecting within dhclient.c. No functional change intended.

Sponsored by: Google LLC (GSoC 2024)
Signed-off-by: Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after: 10 days
Reviwed by: cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request: https://github.com/freebsd/freebsd-src/pull/1368

show more ...


# 16a235f2 08-Jul-2024 Isaac Cilia Attard <icattard@FreeBSD.org>

dhclient: Switch timeouts from time_t to timespec

Introduce a new function, add_timeout_timespec(), to use timespec
structs to handle timeouts. Make add_timeout() into a wrapper for the
latter funct

dhclient: Switch timeouts from time_t to timespec

Introduce a new function, add_timeout_timespec(), to use timespec
structs to handle timeouts. Make add_timeout() into a wrapper for the
latter function to retain compatibility with the rest of the codebase.
No functional change intended.

Sponsored by: Google LLC (GSoC 2024)
Signed-off-by: Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after: 10 days
Reviwed by: cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request: https://github.com/freebsd/freebsd-src/pull/1368

show more ...


# a2e65d45 04-Jul-2024 Brooks Davis <brooks@FreeBSD.org>

dhclient: correct struct ifreq allocation

ioctl commands such as BIOCSETIF take a struct ifreq and due to
FreeBSD's ioctl implementation copy exactly sizeof(struct ifreq) bytes
in so allocate that m

dhclient: correct struct ifreq allocation

ioctl commands such as BIOCSETIF take a struct ifreq and due to
FreeBSD's ioctl implementation copy exactly sizeof(struct ifreq) bytes
in so allocate that much space.

The over-allocaton was harmless, but useless.

Reported by: def
Fixes: e2dc8d789f68a dhclient: do not add 0.0.0.0 interface alias.
Sponsored by: DARPA, AFRL

Reviewed by: def
Differential Revision: https://reviews.freebsd.org/D45769

show more ...


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# e2dc8d78 04-Mar-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

dhclient: do not add 0.0.0.0 interface alias.

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D38908


# 00060820 04-Jun-2020 Mark Johnston <markj@FreeBSD.org>

dhclient: Fix a logic bug remove_protocol().

A logic bug in remove_protocol() meant that it would remove (leak) all
structures in the list preceding the one intended for removal.

PR: 245971
Submit

dhclient: Fix a logic bug remove_protocol().

A logic bug in remove_protocol() meant that it would remove (leak) all
structures in the list preceding the one intended for removal.

PR: 245971
Submitted by: joost@jodocus.org (original version)
MFC after: 1 week

show more ...


# 43d19e6a 08-Apr-2025 Colin Percival <cperciva@FreeBSD.org>

dhclient: Keep two clocks

Until July 2024, dhclient kept track of time as seconds-since-epoch as
a time_t. This was a problem because (a) we wanted sub-second timeouts
and (b) timeouts didn't alway

dhclient: Keep two clocks

Until July 2024, dhclient kept track of time as seconds-since-epoch as
a time_t. This was a problem because (a) we wanted sub-second timeouts
and (b) timeouts didn't always do the right thing if the system clock
changed.

Switching to using CLOCK_MONOTONIC and struct timespec fixed those
issues but introduced a new problem: CLOCK_MONOTONIC values were being
intepreted as seconds-since-epoch and written to the dhclient.leases
file, causing confusion with DHCP leases expiring in early 1970.

Attempt to compromise between these by keeping track of both times;
any type within dhclient which is a time_t now refers to seconds past
the epoch, while any struct timespec value is a CLOCK_MONOTONIC time.

PR: 283256
Reviewed by: dch
Fixes: f0a38976b01e ("dhclient: Use clock_gettime() instead of time()")
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D49720

show more ...


# f0a38976 08-Jul-2024 Isaac Cilia Attard <icattard@FreeBSD.org>

dhclient: Use clock_gettime() instead of time()

Change the use of time() to clock_gettime() to have millisecond-accurate
rather than second-accurate timeouts.

Sponsored by: Google LLC (GSoC 2024)
S

dhclient: Use clock_gettime() instead of time()

Change the use of time() to clock_gettime() to have millisecond-accurate
rather than second-accurate timeouts.

Sponsored by: Google LLC (GSoC 2024)
Signed-off-by: Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after: 10 days
Reviwed by: cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request: https://github.com/freebsd/freebsd-src/pull/1368

show more ...


# 76e0ffd9 08-Jul-2024 Isaac Cilia Attard <icattard@FreeBSD.org>

dhclient: Timeouts for entering state_selecting

Use the new add_timeout_timespec() API to handle timeouts for
state_selecting within dhclient.c. No functional change intended.

Sponsored by: Google

dhclient: Timeouts for entering state_selecting

Use the new add_timeout_timespec() API to handle timeouts for
state_selecting within dhclient.c. No functional change intended.

Sponsored by: Google LLC (GSoC 2024)
Signed-off-by: Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after: 10 days
Reviwed by: cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request: https://github.com/freebsd/freebsd-src/pull/1368

show more ...


# 16a235f2 08-Jul-2024 Isaac Cilia Attard <icattard@FreeBSD.org>

dhclient: Switch timeouts from time_t to timespec

Introduce a new function, add_timeout_timespec(), to use timespec
structs to handle timeouts. Make add_timeout() into a wrapper for the
latter funct

dhclient: Switch timeouts from time_t to timespec

Introduce a new function, add_timeout_timespec(), to use timespec
structs to handle timeouts. Make add_timeout() into a wrapper for the
latter function to retain compatibility with the rest of the codebase.
No functional change intended.

Sponsored by: Google LLC (GSoC 2024)
Signed-off-by: Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after: 10 days
Reviwed by: cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request: https://github.com/freebsd/freebsd-src/pull/1368

show more ...


# a2e65d45 04-Jul-2024 Brooks Davis <brooks@FreeBSD.org>

dhclient: correct struct ifreq allocation

ioctl commands such as BIOCSETIF take a struct ifreq and due to
FreeBSD's ioctl implementation copy exactly sizeof(struct ifreq) bytes
in so allocate that m

dhclient: correct struct ifreq allocation

ioctl commands such as BIOCSETIF take a struct ifreq and due to
FreeBSD's ioctl implementation copy exactly sizeof(struct ifreq) bytes
in so allocate that much space.

The over-allocaton was harmless, but useless.

Reported by: def
Fixes: e2dc8d789f68a dhclient: do not add 0.0.0.0 interface alias.
Sponsored by: DARPA, AFRL

Reviewed by: def
Differential Revision: https://reviews.freebsd.org/D45769

show more ...


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# e2dc8d78 04-Mar-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

dhclient: do not add 0.0.0.0 interface alias.

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D38908


# 00060820 04-Jun-2020 Mark Johnston <markj@FreeBSD.org>

dhclient: Fix a logic bug remove_protocol().

A logic bug in remove_protocol() meant that it would remove (leak) all
structures in the list preceding the one intended for removal.

PR: 245971
Submit

dhclient: Fix a logic bug remove_protocol().

A logic bug in remove_protocol() meant that it would remove (leak) all
structures in the list preceding the one intended for removal.

PR: 245971
Submitted by: joost@jodocus.org (original version)
MFC after: 1 week

show more ...


# 35b930cc 11-Jul-2018 Eugene Grosbein <eugen@FreeBSD.org>

Make dhclient(8) verify if new MTU (option 26) differs from current one and skip unneeded MTU change.
This check eliminates infinite loop of MTU change / link flap / lease verification / MTU change /

Make dhclient(8) verify if new MTU (option 26) differs from current one and skip unneeded MTU change.
This check eliminates infinite loop of MTU change / link flap / lease verification / MTU change / link flap etc.
in case of some NIC drivers like em(4) or igb(4).

N.B.: obsolete u_int16_t is used in consistency with the rest of the file.

PR: 229432
Approved by: mav (mentor)
MFC after: 1 week

show more ...


# 71c6c44d 24-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

dhclient: build with WARNS=6

- add static in a number of places
- initialize __progname rather than rely on magical extern values
- use nitems() instead of manually spelling it out
- unshadow 'idi'

dhclient: build with WARNS=6

- add static in a number of places
- initialize __progname rather than rely on magical extern values
- use nitems() instead of manually spelling it out
- unshadow 'idi'
- teach 'error' that it is '__dead2'
- add missing 'break'

show more ...


# 79a1d195 21-Feb-2018 Alan Somers <asomers@FreeBSD.org>

dhclient: raise WARNS to 4

Mostly const-correctness fixes. There were also some variable-shadowing,
unused variable, and a couple of sockaddr type-correctness changes. I also had
trouble with cast-a

dhclient: raise WARNS to 4

Mostly const-correctness fixes. There were also some variable-shadowing,
unused variable, and a couple of sockaddr type-correctness changes. I also had
trouble with cast-align warnings. I was able to prove that one of them was a
false positive. But ultimately I had to disable the warning program-wide to
deal with the others.

Reviewed by: cem
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D14460

show more ...


# 82725ba9 23-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Merge ^/head r325999 through r326131.


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier f

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

show more ...


# 55b1c6e7 15-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Merge ^/head r325663 through r325841.


# cb003dd9 12-Nov-2017 Mariusz Zaborski <oshogbo@FreeBSD.org>

Use syslog service in dhclient(8).

dhclient(8) is failing during boot to connect to the syslog service, because
syslog daemon is started after dhclient(8). This can be reproduced by stooping
syslog

Use syslog service in dhclient(8).

dhclient(8) is failing during boot to connect to the syslog service, because
syslog daemon is started after dhclient(8). This can be reproduced by stooping
syslog daemon and ktrace the dhclient or use kern.trap_enotcap sysctl and boot
the machine. Using the Casper syslog service fix the problem.

Reviewed by: bapt@
Differential Revision: https://reviews.freebsd.org/D12825

show more ...


# 91b95f3d 04-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r311132 through r311305.


# 4a8c3cd0 04-Jan-2017 Alan Somers <asomers@FreeBSD.org>

Remove dead code in dhclient(8)

The offending code has been dead ever since the import from OpenBSD in
r195805. OpenBSD later deleted that entire function.

Reported by: Coverity
CID: 500059
MFC a

Remove dead code in dhclient(8)

The offending code has been dead ever since the import from OpenBSD in
r195805. OpenBSD later deleted that entire function.

Reported by: Coverity
CID: 500059
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

show more ...


1234