summaryrefslogtreecommitdiff
path: root/sbin/dhclient
AgeCommit message (Collapse)Author
2019-03-18Use same idiom for pretty_print_domain_search() andKenneth R Westerback
pretty_print_classless_routes(), making both of them local to options.c. Avoids a double pretty print of DHO_DOMAIN_SEARCH, eliminates an unneeded 1024 byte static array. Shrinks size of upcoming diff to implement parsing of domain search option in leases and dhclient.conf.
2019-03-18Add a couple of checks to ensure option data fits into the proposalKenneth R Westerback
field being memcpy()'d into. Tweak DHO_ROUTERS handling to be similar to the other cases populating proposal->rtstatic, including a warning when things go wrong.
2019-03-18explicitly use BPF_FILDROP_CAPTURE when configuring BIOCSFILDROPDavid Gwynne
BIOCSFILDROP used to just be a flag, ie, any non-zero value was treated the same, but i'm changing it so different values do different things. this way the programs should keep working even if i decide to change the values for these macros.
2019-02-26add domain-search to the list of options capable of adding to resolv.conf;Jason McIntyre
confirmed by and ok krw
2019-02-23Correct comment on delete_addresses() return value.Kenneth R Westerback
2019-02-23Restore pre-a2k19 behaviour of clearing out all existing addressesKenneth R Westerback
when setting new address. That change needs specific consideration rather than inadvertant inclusion, especially after claiming no functional change was being made. Change and related problems noted and reversion tested by Kurt Mosiejczuk.
2019-02-16SSID/LLADDR/LINK_STATE_IS_UP changes must discard the previousKenneth R Westerback
proposal to ensure the new lease is applied to the interface.
2019-02-13Nuke unused variable.Kenneth R Westerback
2019-02-13Try harder to start a new line when link is obtained and a newKenneth R Westerback
message is about to be displayed on the console.
2019-02-12Restructure code to simplifiy imsg communications, further separatingKenneth R Westerback
DHCP knowledge and interface manipulation. Unprivileged process now sends proposal derived from the accepted lease to the privileged process rather than individual interface manipulation requests. The only intended functional change is that /etc/resolv.conf.tail is not re-read each time a new proposal is implemented, rather than once at dhclient startup.
2019-01-26Rename ACTION_NONE to ACTION_USELEASE. TOK_NOACTION to TOK_USELEASE.Kenneth R Westerback
More consistent, clearer.
2019-01-26Zap trailing space that stuck its head up.Kenneth R Westerback
2019-01-26Add 'uselease' statement to allow the disabling of built-in orKenneth R Westerback
previously specified 'append', 'default', 'ignore', 'prepend', or 'supersede' actions on the values provided in leases.
2019-01-22Simply the logic translating 'egress' into an interface name.Kenneth R Westerback
2019-01-21Allocate buffer before using it.Kenneth R Westerback
Encountered, diagnosed, fix tested and ok jca@
2019-01-21Typo. "nterface" -> "interface"Kenneth R Westerback
2019-01-20Don't delay signal(SIGPIPE, SIG_IGN) until go_daemon() does it. First,Kenneth R Westerback
go_daemon() may not be called before the first error. Second, go_daemon() doesn't do anything when '-d' is specified.
2019-01-19Since there is no more exec()'ing, there is no need toKenneth R Westerback
save a copy of the original argv.
2019-01-19Since dhclient no longer tries to clean up when exiting, there is noKenneth R Westerback
need to start a new copy when LLADDR or SSID changes. Just go back to S_PREBOOT and get a new lease. Fewer log messages, faster join'ing new networks, simpler code.
2019-01-19IMSG_HUP -> IMSG_RESTART. sendhup() -> sendrestart.Kenneth R Westerback
2019-01-19Drop pseudo-signal idiom. Rename INTERNALSIG to TERMINATE. Use RESTARTKenneth R Westerback
instead of overloading SIGHUP.
2019-01-19'quit' no longer holds signals, so strsignal(quit) is both pointlessKenneth R Westerback
and now in unreachable code. Simplifies dispatch loops by eliminating most uses of INTERNALSIG.
2019-01-19'quit' is no longer set in a signal handler so it no longer needs toKenneth R Westerback
be sig_atomic_t. Plain int should be sufficient.
2019-01-18Move link state change test & check for new lladdr intoKenneth R Westerback
interface_state(). Simplifies code a bit.
2019-01-18Ignore HUP signals. If you need to modify the running configurationKenneth R Westerback
just run dhclient again, which does the same thing. i.e. kills existing dhclient processes and exec's a new copy. One less knob. Improves documention by eliminating very non-standard SIGNALS section. Feedback from schwarze@. ok deraadt@
2019-01-18Oops. Nuke debug statement that snuck it.Kenneth R Westerback
2019-01-18Shuffle lease file reading code to improve clarity and shorten someKenneth R Westerback
lines. No intentional functional change.
2019-01-18Yet another long line broke cover.Kenneth R Westerback
2019-01-18Be consistent in explicitly testing memcmp() return values.Kenneth R Westerback
2019-01-17Split a long line that wandered into theKenneth R Westerback
crosshairs.
2019-01-17Split a long line that wandered into theKenneth R Westerback
crosshairs.
2019-01-17Move "link X -> Y" debug messages into insterface_state() whereKenneth R Westerback
the link field is actually modified. Thus catching all places where a link state change might be detected.
2019-01-14Make apply_ignore_list(), set_default_hostname(),Kenneth R Westerback
set_default_client_identifier() and read_resolv_conf_tail() local to clparse.c and just call them from read_conf().
2019-01-14Abstract allocation and initialization of config globalKenneth R Westerback
variable into init_config() and just call it from read_conf().
2019-01-14set_default_client_identifier() only needs theKenneth R Westerback
struct ether_addr (a.k.a. ifi->hw_address) rather than the entire struct interface_info.
2019-01-14Check NULLness of ignore list inside apply_ignore_list() and notKenneth R Westerback
before calling it.
2019-01-13Abstract /etc/resolv.conf.tail reading out of main()Kenneth R Westerback
and into a read_resolv_conf_tail() in clparse.c.
2019-01-13White space nits.Kenneth R Westerback
2019-01-13Shuffle apply_ignore_list(), set_default_client_identifier() andKenneth R Westerback
set_default_host_name() to clparse.c as they are part of config initialization. First step in cleanup of startup logic.
2019-01-10"AF_* values are *almost* always the correct choice, particularly withKenneth R Westerback
POSIX APIs". Also sprach guenther@. So switch PF_ROUTE to AF_ROUTE in socket() and setsockopt() calls. Keep PF_ROUTE in sysctl(2) uses. adding a comment for future visitors, Also replace PF_UNSPEC with 0 in socketpair(), as socketpair(2) points out this is the only sensible value. Cluebat from and ok guenther@
2019-01-09Use PF_ROUTE consistently rather than tossing inKenneth R Westerback
a couple of AF_ROUTE.
2019-01-05Simplify and clarify (i.e. shrink) code processingKenneth R Westerback
the bpf captures.
2019-01-05KNF nit.Kenneth R Westerback
2019-01-03The need for separate bpf and routing message buffers was eliminatedKenneth R Westerback
when dhclient moved to processing the entire buffer rather than trying to process one packet per dispatch() loop. So use ifi->rbuf for both purposes, resizing it during initialization to accommodate the larger of the routing socket read size or the bpf socket read size. Eliminates a calloc()/free() per routing socket read.
2018-12-28Join other daemons in assuming that a single read from a routingKenneth R Westerback
socket may contain more than one RTM_* message. Adopt the claudian variant (pointer arithmetic/comparison) of doing this. The isolation of dhclient in assuming each routing socket read will return only one message pointed out by Gregor Best.
2018-12-27Rename ufdesc to udpfd to make the code slightly more intuitive.Kenneth R Westerback
2018-12-27Rename routehandler() to routefd_handler() to make the code slightlyKenneth R Westerback
more intuitive.
2018-12-27Rename bfdesc to bpffd and packethandler() to bpffd_handler() to makeKenneth R Westerback
the code slightly more intuitive.
2018-12-27No need to return early when setting the tick stop.Kenneth R Westerback
2018-12-25No need for magic tick_msg(NULL,..) call toKenneth R Westerback
set stop time. The stop time is always config->link_timeout seconds after the first call to tick_msg().