Age | Commit message (Collapse) | Author |
|
for a couple of years, backed by dhcpleased(8), which provides much better
dns handling. The next step is to make the dhclient simply execve
ifconfig in that way, and provide syslog warnings about deprecated options
along the way. This way, we can find the last few dhclient users, and what
they are missing.
ok florian krw
|
|
3rd (variadic) mode_t parameter is irrelevant. Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk. They could all be 0xdeafbeef.
ok millert
|
|
set_iff_up() is called from initialize_interface() and was using
log_procname instead of ifi->name in its fatal()'s.
Diagnosed by tb@ from a recent reddit post by zielonykid1234.
|
|
dhclient instances for the interface, check if the IPv4
AUTOCONF flag is set. If it is, go quietly into that good
night and let dhcpleased do its thing, comforted by the fact
that dhcpleased knows that a new lease has been requested.
requested, tested & ok florian@
|
|
fails to report the path that the failure occured on. Suggested by
deraadt@ after some tech discussion.
Work done and verified by Ashton Fagg <ashton@fagg.id.au>
ok deraadt@ semarie@ claudio@
|
|
initialize_interface() logic into closer alignment, and try harder to
initialize link_state at start up.
|
|
|
|
(ACK/NAK), add details (DISCOVER/REQUEST) and provide
before/after info for SSID/LLADDR/MTU changes.
|
|
rather than waiting for select_timeout to expire before accepting the same
OFFER.
|
|
requested in the DISCOVER.
i.e. immediately accept the OFFER rather than waiting for select_timeout to
expire before accepting the same OFFER.
A corner case since select-timeout is 0 by default.
|
|
|
|
Call tick_msg() at startup so it knows if the link
is up. Don't emit 'link timeout expired' messages
after the link has been up.
|
|
cross flip CLOCK_REALTIME to CLOCK_MONOTONIC.
Suggested by cheloha@, millert@, otto@ at various
stages in the time_t -> timespec conversion.
|
|
timespec values. Translate from the epoch values in leases
to timespec values in one place.
Final step to allow CLOCK_REALTIME -> CLOCK_MONOTONIC time
accounting for the active lease.
|
|
|
|
|
|
are exceeded.
Feedback from otto@, cheloha@
|
|
Feedback from otto@
|
|
already gone daemon. Sometimes it's just that 2>/dev/null or something has
been done.
Should fix problem with sysupgrade when an interface (e.g. a wired interface that
has no cable plugged in) never comes up.
Problem reported and debug info from kettenis@, Jean-Philippe Luigi, Thomas L. and
Markus Lude. Thanks!
|
|
toss expired leases when writing the list to disk. And write the list
to disk before using a lease from it. Just make sure ifi->active
isn't tossed.
|
|
calls to avoid losing those debug messages if
tick_msg() notices link-timeout has expired and daemonizes
dhclient.
|
|
grace period of silence before emitting "<if>: no lease...", even if
the link has taken a few secocnds to come up. 'link-timoeut' remains
the hard deadline for going daemon.
|
|
required in read_lease_db(). It's already set in packet_to_lease() and
thus both paths to TAILQ_INSERT(lease_db) ensure there is a non-zero
epoch in all lease_db entries.
|
|
Simplifies -v output, and reduces non-'-v' output.
Reduce non-'-v' output further by only displaying the first 'link up'
event.
Restore behaviour specified in dhclient.conf(5) of going daemon after
link-timeout seconds, rather than waiting another link-timeout seconds
for a lease to be accepted.
Lease verbiage problem reported, and fix tested by Mihai Popescu. Thanks!
Link verbiage problems reported, fix tested & ok tb@.
|
|
No functional change but a bit more obvious and shrinks upcoming diff.
|
|
obtained cur_time to initialize a missing lease->epoch.
|
|
leases. It can't be NULL, and is unconditionally dereferenced a few lines
later anyway.
|
|
|
|
for future attempts at making it more IPv6-like.
ok florian@
|
|
default reboot interval of 1 sec. Gives the DHCP server a
fairer shot at replying before the timeout expires.
ok millert@
|
|
'reboot_timeout' to 'offer_interval', 'link_interval' and
'reboot_interval' to be consistant with other '_interval' fields that
specify a number of seconds to wait.
|
|
tracked in tick_msg() and explicitly calling tick_msg(TICK_SLEEP).
One fewer use of each of time(), ifi->startup_time and
config->link_timeout. Makes code easier to follow.
No intentional functional change.
|
|
invoked when log_getverbose() returns 0.
|
|
into new set_interval()/set_secs() functions. send_request() and
send_discover() become much easier to understand.
No intentional functional change.
|
|
|
|
reliable and consistant.
Eliminate unused time_t parameter since we only tick during the first
link_timeout seconds. Replace it with 'action' parameter to clearly
indicated what tick_msg() is supposed to do.
Fix issuance of '\n' before log_debug() messages. Properly
reinitialize static variables.
Use more precise 'timespec' timers, hewing to idiom suggested by
cheloha@.
|
|
Switch from poll(2) to ppoll(2) in a few more functions.
Because we're working with ppoll(2) and clock_gettime(2) it is easier
to encode the various timeouts as static const timespecs instead of
preprocessor macros. This way we aren't packing timespecs in the
middle of the code, which distracts from the (more important) logic of
what the code is doing.
Part of a larger campaign improve "time stuff" in dhclient(8).
Prompted by and discussed with krw@. Based on a diff by krw@.
ok krw@
|
|
when an invalid option name is encountered.
|
|
file.
Original diff, tweaks & ok kn@
|
|
get_routefd() and set_user().
|
|
internal structure reflecting the interface into a function that in turn
calls simple helper functions to do the different actions involved.
Simplifies the overly lengthy main(), correctly starts the state machine
with the state of the interface link as DOWN when IFF_UP is 0, tests
more initialization actions when '-n' is used.
|
|
Check quit != TERMINATE before trying to open leases file.
|
|
configuration changges.
|
|
lease and use the updated values to initialize ifi->expiry and
ifi->rebinding.
Fixes odd behaviour, bouncing the link in particular, when using
dhclient.conf to change the lease renew/rebind/expiry timing. e.g. when
debugging wifi interface behaviour.
|
|
|
|
1) The RTM_PROPOSAL telling unwind(8) about DNS servers is seen.
2) The interface is in the process of getting a new or renewed lease.
3) The default route is not UP.
Edge cases discovered while debugging urtwn(4) link bouncing.
|
|
in interface_state() as it is elsewhere.
Avoids any possible NULL pointer dereference.
|
|
appropriate ifa is already known and ifi->rdomain does not need to be
updated because a change of rdomain causes a link bounce and thus
reinitialization of ifi.
One less invocation of getifaddrs() during route message processing.
|
|
man page and usage() tweaks from jmc@.
ok lteo@
|
|
DECLINE messages emitted when required options were missing did not contain the
address.
Reported via tech@ and fix tested by Dominik Schreilechner.
|