OpenBSD CVS

CVS log for src/sbin/dhclient/dhcpd.h


[BACK] Up to [local] / src / sbin / dhclient

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.299 / (download) - annotate - [select for diffs], Sun Mar 28 16:23:05 2021 UTC (3 years, 2 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, HEAD
Changes since 1.298: +4 -2 lines
Diff to previous 1.298 (colored)

Convert remaining timers (lease renew, rebind, expiry) to
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.

Revision 1.298 / (download) - annotate - [select for diffs], Wed Mar 24 16:04:10 2021 UTC (3 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.297: +2 -2 lines
Diff to previous 1.297 (colored)

More timespec conversions. Less 'seconds' arithmetic.

Revision 1.297 / (download) - annotate - [select for diffs], Thu Mar 11 15:30:49 2021 UTC (3 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.296: +3 -1 lines
Diff to previous 1.296 (colored)

Use timespec timers to determine when select-timeout and timeout intervals
are exceeded.

Feedback from otto@, cheloha@

Revision 1.296 / (download) - annotate - [select for diffs], Tue Mar 9 14:32:24 2021 UTC (3 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.295: +2 -2 lines
Diff to previous 1.295 (colored)

Replace time_t startup_time with struct timespec link_timeout.

Feedback from otto@

Revision 1.295 / (download) - annotate - [select for diffs], Wed Feb 24 16:18:59 2021 UTC (3 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.294: +1 -2 lines
Diff to previous 1.294 (colored)

Remove incomplete/incorrect connection with autoconf, clearing ground
for future attempts at making it more IPv6-like.

ok florian@

Revision 1.294 / (download) - annotate - [select for diffs], Mon Feb 22 23:43:59 2021 UTC (3 years, 3 months ago) by jsg
Branch: MAIN
Changes since 1.293: +1 -3 lines
Diff to previous 1.293 (colored)

remove unused decode_hw_header() function

ok krw@

Revision 1.293 / (download) - annotate - [select for diffs], Mon Feb 22 02:19:03 2021 UTC (3 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.292: +2 -1 lines
Diff to previous 1.292 (colored)

Switch reboot timing to timespec, the better to handle the
default reboot interval of 1 sec. Gives the DHCP server a
fairer shot at replying before the timeout expires.

ok millert@

Revision 1.292 / (download) - annotate - [select for diffs], Sun Feb 21 18:16:59 2021 UTC (3 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.291: +4 -4 lines
Diff to previous 1.291 (colored)

Rename struct client_config fields 'timeout', 'link_timeout' and
'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.

Revision 1.291 / (download) - annotate - [select for diffs], Mon Feb 1 01:42:20 2021 UTC (3 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.290: +2 -2 lines
Diff to previous 1.290 (colored)

Switch dispatch loop to ppoll() and protocol timeouts to struct timespec.

Reduces spurious packet transmissions in situations with short timings.

Suggestions millert@, further suggestions & ok cheloha@

Revision 1.290 / (download) - annotate - [select for diffs], Thu Dec 10 18:35:32 2020 UTC (3 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.289: +2 -3 lines
Diff to previous 1.289 (colored)

Simplify '-i' handling, failing immediately during command line parsing
when an invalid option name is encountered.

Revision 1.289 / (download) - annotate - [select for diffs], Sun Dec 6 17:40:43 2020 UTC (3 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.288: +1 -2 lines
Diff to previous 1.288 (colored)

fatal() immediately whem parsing command line option '-c' reveals a non-existant
file.

Original diff, tweaks & ok kn@

Revision 1.288 / (download) - annotate - [select for diffs], Fri Nov 6 21:53:55 2020 UTC (3 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.287: +1 -2 lines
Diff to previous 1.287 (colored)

Remove the -L option. A debugging tool that is no longer required.

man page and usage() tweaks from jmc@.

ok lteo@

Revision 1.287 / (download) - annotate - [select for diffs], Thu May 21 01:07:52 2020 UTC (4 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.286: +3 -3 lines
Diff to previous 1.286 (colored)

extract_classless_route() -> extract_route() as there is only the one route
extraction function.

Revision 1.286 / (download) - annotate - [select for diffs], Thu May 14 13:57:13 2020 UTC (4 years ago) by krw
Branch: MAIN
Changes since 1.285: +2 -2 lines
Diff to previous 1.285 (colored)

Massage merge_option_data() to be more careful when dealing with 'D'
(domain search) and 't' (text) options. Enables append/prepend for the
domain-search option by inserting blanks between the domains and
ensures the presence of a terminating NUL when merging text.

Revision 1.285 / (download) - annotate - [select for diffs], Thu Jan 23 22:39:35 2020 UTC (4 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.284: +8 -5 lines
Diff to previous 1.284 (colored)

Separate command line syntax parsing from semantic validation of
command line contents. Display usage() when syntax is incorrect and
relevant error messages when semantic checks fail.

More akin to the way other commands handle the syntax/semantic split.

Idea taken from a larger diff by kn@.

ok kn@

Revision 1.284 / (download) - annotate - [select for diffs], Fri Nov 22 22:45:52 2019 UTC (4 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.283: +2 -2 lines
Diff to previous 1.283 (colored)

Polish logic talking to unwind.

ok florian@

Revision 1.283 / (download) - annotate - [select for diffs], Tue Nov 19 14:35:08 2019 UTC (4 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.282: +4 -1 lines
Diff to previous 1.282 (colored)

Inform unwind about DNS servers it finds in leases.

ok florian@

Revision 1.282 / (download) - annotate - [select for diffs], Tue Jul 30 12:48:27 2019 UTC (4 years, 10 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.281: +2 -1 lines
Diff to previous 1.281 (colored)

Use AUTOCONF4 flag. Set the flag on startup. But if the flag is
subsequently reset by ifconfig(8) then stop applying leases. If the
flag is set after being reset then get a new lease and carry on.

Clean up man page verbiage and add AUTOCONF4 description.

ok benno@, man page formatting ok ingo@

Revision 1.281 / (download) - annotate - [select for diffs], Mon Jul 22 17:20:06 2019 UTC (4 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.280: +2 -2 lines
Diff to previous 1.280 (colored)

Cleanup/simplify parse_number():

1) Restructure to explicitly set a long long result and take the
desired low/high constraints for strtonum().

2) No need to use a temporary variable when setting long long
(a.k.a. time_t) fields.

3) Fewer magic numbers when processing integer valued option
data. Less memcpy()'ing where a cast or two is sufficient to make
integer assignment work.

No intentional functional change.

Revision 1.280 / (download) - annotate - [select for diffs], Sun Jul 21 15:47:02 2019 UTC (4 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.279: +2 -2 lines
Diff to previous 1.279 (colored)

Replace malloc()/memcpy() with strdup() in parse_string(). Nuke 'len' parameter
to parse_string() in favour of taking strlen() of resulting string in the few
cases that it is of interest.

Revision 1.279 / (download) - annotate - [select for diffs], Fri Jul 19 20:50:22 2019 UTC (4 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.278: +2 -2 lines
Diff to previous 1.278 (colored)

Nuke a bunch of 'name' parameters that haven't been used since
dhclient(8) stopped writing interface names in the leases file.

Revision 1.278 / (download) - annotate - [select for diffs], Wed May 22 12:56:31 2019 UTC (5 years ago) by krw
Branch: MAIN
Changes since 1.277: +2 -1 lines
Diff to previous 1.277 (colored)

Don't get & apply a new lease for an RTM_IFINFO that reports a change
to the MTU of the interface. Such message are generated by the
application of a lease containing interface-mtu, and thus caused a
duplicate lease negotiation and application when that option
was present.

This rapid duplication confused Google Compute Engine.


Noticed and fix tested by Greg Steuck. Also tested by Bj??rn Ketelaars
to make sure Dutch Railways still worked. Thanks!

ok claudio@

Revision 1.277 / (download) - annotate - [select for diffs], Tue Apr 2 02:59:43 2019 UTC (5 years, 2 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.276: +2 -2 lines
Diff to previous 1.276 (colored)

Add human readable parsing/display of RFC1035 data in domain-search
option. Replace handrolled dn_expand() with the system
version. Existing hex octet versions still accepted. New format is

option domain-search "my.domain.org", "fw.my.domain.org";

It is now possible to append and prepend domains to the list provided
by the server.

Documention update to dhcp-options(5) in the pipeline!

Inspired by dhcpd(8) domain-search diff from William Ahern.

Code peered at by florian@ and kn@.

Revision 1.276 / (download) - annotate - [select for diffs], Fri Mar 22 16:45:48 2019 UTC (5 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.275: +2 -1 lines
Diff to previous 1.275 (colored)

Revert parts of recent changes to pretty_print_domain_search(). Parts
of WIP escaped into the wild and broke parsing of domain-search.

Reported by Greg Steuck and Raf Czlonka. Fix tested by Greg.

Revision 1.275 / (download) - annotate - [select for diffs], Wed Mar 20 20:10:00 2019 UTC (5 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.274: +4 -1 lines
Diff to previous 1.274 (colored)

Do not accept dhclient.conf(5) "prepend" or "append" statements when
the option data cannot be prepended or appended to. Instead, treat
"prepend" as "supersede" and "append" as "default". This preserves the
safe aspects of current behaviour. Issue a parsing warning when
appropriate to encourage people to fix their configuration files.

Eliminate egregious repeated code by abstracting merge_option_data().

Revision 1.274 / (download) - annotate - [select for diffs], Mon Mar 18 22:26:56 2019 UTC (5 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.273: +1 -4 lines
Diff to previous 1.273 (colored)

Use same idiom for pretty_print_domain_search() and
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.

Revision 1.273 / (download) - annotate - [select for diffs], Tue Feb 12 16:50:44 2019 UTC (5 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.272: +4 -9 lines
Diff to previous 1.272 (colored)

Restructure code to simplifiy imsg communications, further separating
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.

Revision 1.272 / (download) - annotate - [select for diffs], Sat Jan 26 23:26:20 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.271: +2 -2 lines
Diff to previous 1.271 (colored)

Rename ACTION_NONE to ACTION_USELEASE. TOK_NOACTION to TOK_USELEASE.
More consistent, clearer.

Revision 1.271 / (download) - annotate - [select for diffs], Sat Jan 19 21:07:13 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.270: +2 -1 lines
Diff to previous 1.270 (colored)

Since dhclient no longer tries to clean up when exiting, there is no
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.

Revision 1.270 / (download) - annotate - [select for diffs], Sat Jan 19 02:45:05 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.269: +3 -2 lines
Diff to previous 1.269 (colored)

Drop pseudo-signal idiom. Rename INTERNALSIG to TERMINATE. Use RESTART
instead of overloading SIGHUP.

Revision 1.269 / (download) - annotate - [select for diffs], Sat Jan 19 01:53:08 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.268: +2 -2 lines
Diff to previous 1.268 (colored)

'quit' is no longer set in a signal handler so it no longer needs to
be sig_atomic_t. Plain int should be sufficient.

Revision 1.268 / (download) - annotate - [select for diffs], Mon Jan 14 04:54:46 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.267: +2 -6 lines
Diff to previous 1.267 (colored)

Make apply_ignore_list(), set_default_hostname(),
set_default_client_identifier() and read_resolv_conf_tail() local to
clparse.c and just call them from read_conf().

Revision 1.267 / (download) - annotate - [select for diffs], Mon Jan 14 04:05:42 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.266: +2 -1 lines
Diff to previous 1.266 (colored)

Abstract allocation and initialization of config global
variable into init_config() and just call it from
read_conf().

Revision 1.266 / (download) - annotate - [select for diffs], Mon Jan 14 03:05:33 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.265: +2 -2 lines
Diff to previous 1.265 (colored)

set_default_client_identifier() only needs the
struct ether_addr (a.k.a. ifi->hw_address) rather
than the entire struct interface_info.

Revision 1.265 / (download) - annotate - [select for diffs], Sun Jan 13 23:15:31 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.264: +2 -1 lines
Diff to previous 1.264 (colored)

Abstract /etc/resolv.conf.tail reading out of main()
and into a read_resolv_conf_tail() in clparse.c.

Revision 1.264 / (download) - annotate - [select for diffs], Sun Jan 13 18:45:21 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.263: +4 -1 lines
Diff to previous 1.263 (colored)

Shuffle apply_ignore_list(), set_default_client_identifier() and
set_default_host_name() to clparse.c as they are part of config
initialization. First step in cleanup of startup  logic.

Revision 1.263 / (download) - annotate - [select for diffs], Sat Jan 5 21:40:44 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.262: +3 -5 lines
Diff to previous 1.262 (colored)

Simplify and clarify (i.e. shrink) code processing
the bpf captures.

Revision 1.262 / (download) - annotate - [select for diffs], Thu Jan 3 16:42:30 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.261: +2 -1 lines
Diff to previous 1.261 (colored)

The need for separate bpf and routing message buffers was eliminated
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.

Revision 1.261 / (download) - annotate - [select for diffs], Thu Dec 27 17:33:15 2018 UTC (5 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.260: +2 -2 lines
Diff to previous 1.260 (colored)

Rename ufdesc to udpfd to make the code slightly more intuitive.

Revision 1.260 / (download) - annotate - [select for diffs], Thu Dec 27 17:19:56 2018 UTC (5 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.259: +2 -2 lines
Diff to previous 1.259 (colored)

Rename routehandler() to routefd_handler() to make the code slightly
more intuitive.

Revision 1.259 / (download) - annotate - [select for diffs], Thu Dec 27 17:02:03 2018 UTC (5 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.258: +2 -2 lines
Diff to previous 1.258 (colored)

Rename bfdesc to bpffd and packethandler() to bpffd_handler() to make
the code slightly more intuitive.

Revision 1.258 / (download) - annotate - [select for diffs], Sun Nov 11 00:49:05 2018 UTC (5 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.257: +2 -3 lines
Diff to previous 1.257 (colored)

As get_hw_address() is called early and unconditionally sets
VALID_LLADDR, there is longer much point to VALID_LLADDR. Nuke it.

Just check for lladdr changes when LINK_STATUS_IS_UP().

Revision 1.257 / (download) - annotate - [select for diffs], Fri Nov 2 16:15:55 2018 UTC (5 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.256: +1 -2 lines
Diff to previous 1.256 (colored)

When reacting to SIGHUP, i.e. trying to restart, ignore incoming
packets, routing socket messages and cancel any pending protocol
timeout.

Since >1 packet can be received from bpf at a time, don't process any
further buffered packets after one triggers a decision to exit or
a signal is received.

Revision 1.256 / (download) - annotate - [select for diffs], Wed May 23 12:18:58 2018 UTC (6 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.255: +2 -2 lines
Diff to previous 1.255 (colored)

Some interfaces (e.g. cdce(4)) can't tell if they are connected.  They
always report a link status of UNKNOWN.

Do not use recorded leases to configure such interfaces. In such
cases only use the address in the recorded lease to ask for a
new lease.

Avoids debilitating /etc/resolv.conf changes by unplugged higher
priority interfaces given to the tender mercies of dhclient after a
working interface has already set /etc/resolv.conf correctly.

Reported for cdce(4) by guenther@ at p2k18.

Revision 1.255 / (download) - annotate - [select for diffs], Sat May 19 22:10:22 2018 UTC (6 years ago) by krw
Branch: MAIN
Changes since 1.254: +2 -1 lines
Diff to previous 1.254 (colored)

Add '-r', which causes running dhclient to release
lease and exit.

Man page tweaks from jmc@.

Request, tests & ok tb@. ok millert@ on previous
version.

Revision 1.254 / (download) - annotate - [select for diffs], Wed Feb 28 22:16:56 2018 UTC (6 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.253: +1 -7 lines
Diff to previous 1.253 (colored)

Now that log_debug() has been decyphered, replace DPRINTF() instances
with log_debug() so -v unleashes all debug output without having to
compile a custom dhclient.

Revision 1.253 / (download) - annotate - [select for diffs], Sat Feb 10 23:25:15 2018 UTC (6 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.252: +12 -10 lines
Diff to previous 1.252 (colored)

Fix 'ignore ;' so that it really does reset the ignore list.

Mkae 'ignore', 'request' and 'require' cumulative so all
options don't have to be jammed into one line.

Revision 1.252 / (download) - annotate - [select for diffs], Wed Feb 7 01:03:10 2018 UTC (6 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.251: +2 -1 lines
Diff to previous 1.251 (colored)

Keep track of the last proposal used to configure the interface and
compare that to the offered proposal to determine if there are any
changes to configure. Simpler, and fixes issue where using a recorded
lease meant the interface was continually being configured with the
same information.

Revision 1.251 / (download) - annotate - [select for diffs], Tue Feb 6 21:09:10 2018 UTC (6 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.250: +2 -3 lines
Diff to previous 1.250 (colored)

Nuke unused state S_REBINDING. We just use the time
to decide between unicast and broadcast for REQUEST.

Revision 1.250 / (download) - annotate - [select for diffs], Tue Feb 6 00:25:09 2018 UTC (6 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.249: +2 -2 lines
Diff to previous 1.249 (colored)

Flip -q (be quiet) into -v (be noisy), making terseness the default
behaviour.

Always go daemon after link_timeout seconds and complete lease
negotiations in the background if necessary. No hanging around in the
foreground for the full 64 seconds waiting for a server to appear.

Log a more relevant message when a default route can't be obtained via
RTM_GET. i.e. "no default route" rather than "No such process".

-q -> -v ok mpi@

Revision 1.249 / (download) - annotate - [select for diffs], Tue Jan 30 13:22:42 2018 UTC (6 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.248: +2 -1 lines
Diff to previous 1.248 (colored)

Expand "bound to ..." message to include the source of the lease,
either the server IP/MAC or the name of the leases file.

Prompted by phessler@ and landry@ feedback to another diff.

ok phessler@

Revision 1.248 / (download) - annotate - [select for diffs], Mon Jan 29 15:18:05 2018 UTC (6 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.247: +2 -2 lines
Diff to previous 1.247 (colored)

Missed a couple of log_info()'s in previous commit. Use #ifdef DEBUG
instead of #if DEBUG.

Revision 1.247 / (download) - annotate - [select for diffs], Sun Jan 28 23:12:36 2018 UTC (6 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.246: +7 -4 lines
Diff to previous 1.246 (colored)

Refactor and simplify the logic to select and invoke the
appropriate function to process a packet.

Revision 1.246 / (download) - annotate - [select for diffs], Thu Jan 25 15:43:51 2018 UTC (6 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.245: +7 -1 lines
Diff to previous 1.245 (colored)

Add DPRINTF() and use it to replace log_debug() statements inside
#ifdef DEBUG/#endif blocks.

Suggestions on correct idiom (C99 vs gcc) from millert@

ok tom@

Revision 1.245 / (download) - annotate - [select for diffs], Thu Jan 4 03:02:05 2018 UTC (6 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.244: +1 -2 lines
Diff to previous 1.244 (colored)

parse_lease_time() is an unnecessary abstraction. Just use
parse_number('L') since it is parsing unsigned 32bit integers.

Revision 1.244 / (download) - annotate - [select for diffs], Thu Jan 4 02:27:55 2018 UTC (6 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.243: +2 -2 lines
Diff to previous 1.243 (colored)

We only parse decimal numbers, so parse_decimal() -> parse_number() to
match grammar comments and improve euphony.

Revision 1.243 / (download) - annotate - [select for diffs], Mon Dec 18 14:17:58 2017 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.242: +1 -2 lines
Diff to previous 1.242 (colored)

Stop inserting and paying attention to 'interface <if>;'
inside 'lease {}' declarations. We don't keep leases from
multiple interfaces in dhclient.leases.<if> files.

One less thing to parse and keep in memory. More rope for
those wanting to do unspeakable things with their lease files.

Revision 1.242 / (download) - annotate - [select for diffs], Sat Dec 16 20:47:53 2017 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.241: +6 -6 lines
Diff to previous 1.241 (colored)

With leases no longer in dhclient.conf, rename a bunch of
functions and fields to more obvious names reflecting this
separation.

Revision 1.241 / (download) - annotate - [select for diffs], Sat Dec 9 15:48:04 2017 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.240: +3 -4 lines
Diff to previous 1.240 (colored)

Add ACTION_IGNORE and nuke ignored_options, ignored_option_count fields
in struct client_config.

Revision 1.240 / (download) - annotate - [select for diffs], Thu Dec 7 19:03:15 2017 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.239: +1 -2 lines
Diff to previous 1.239 (colored)

Nuke support for defining last-gasp leases in dhclient.conf.

Revision 1.239 / (download) - annotate - [select for diffs], Wed Dec 6 13:57:27 2017 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.238: +1 -2 lines
Diff to previous 1.238 (colored)

Disentangle dhclient.conf static lease handling from dynamic
lease handling. Simplifies code and makes it easier to
consider excising this 'feature'.

Revision 1.238 / (download) - annotate - [select for diffs], Sun Dec 3 20:53:28 2017 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.237: +2 -3 lines
Diff to previous 1.237 (colored)

Move timer fields 'expiry" and "rebind" out of struct client_lease
and into struct interface_info. Nuke set_lease_times().

Revision 1.237 / (download) - annotate - [select for diffs], Fri Nov 24 01:39:29 2017 UTC (6 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.236: +2 -2 lines
Diff to previous 1.236 (colored)

Remove 'renewal' field from struct client_lease. Add lease_renewal() to
calculate the value when required for a particular lease.

Revision 1.236 / (download) - annotate - [select for diffs], Thu Nov 9 12:34:25 2017 UTC (6 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.235: +2 -2 lines
Diff to previous 1.235 (colored)

Use lease 'epoch' (time lease was acquired) to calculate timers for
renew/rebind/expiry. Treat renew/rebind/expiry statements in leases as
comments for human consumption.

Revision 1.235 / (download) - annotate - [select for diffs], Mon Nov 6 13:27:19 2017 UTC (6 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.234: +2 -1 lines
Diff to previous 1.234 (colored)

Add lease declaration 'epoch' to hold the time() when a lease is
received. Set it in packet_to_lease() and preserve it in
apply_defaults(). Otherwise not used, documented or printed in lease
database yet.

Revision 1.234 / (download) - annotate - [select for diffs], Fri Oct 27 15:10:16 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.233: +5 -1 lines
Diff to previous 1.233 (colored)

Add '-n' option to just parse dhclient.conf for errors.

ok jmc@ tb@

Revision 1.233 / (download) - annotate - [select for diffs], Mon Oct 23 13:01:20 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.232: +2 -1 lines
Diff to previous 1.232 (colored)

Enforce dhclient.conf prohibitions on nesting 'interface'
declarations and placing 'lease' declarations inside
'interface' declarations.

Document and enforce requirement that all 'lease'
declarations must specify the interface to which they
apply.

Ignore static leases that apply to other interfaces rather
than complaining the interface name is wrong and using the
lease anyway.

Revision 1.232 / (download) - annotate - [select for diffs], Sat Oct 14 15:31:46 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.231: +1 -2 lines
Diff to previous 1.231 (colored)

Refactor parsing of hex sequences. Rename parse_X()
to parse_hex_octets() and have it return 0/1 to indicate success,
to not touch existing data on error paths, to handle ';'
better, emit single error message ("expecting colon
delimited list of hex octets."). Fold parse_hex() into
parse_hex_octets().

Simplify logic in parse_option_decl() to eliminate duplicate
overflow error checking and error messages as a result.

Revision 1.231 / (download) - annotate - [select for diffs], Thu Oct 12 13:10:13 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.230: +2 -2 lines
Diff to previous 1.230 (colored)

Make parse_string() toe the new line by returning
0 for failure, 1 for success, emitting a
single error message ("expecting string.") and
handling ';' better.

Don't leak memory when encountering pathological
config or lease files containing repeated instances
of an option or command with string data.

Revision 1.230 / (download) - annotate - [select for diffs], Wed Oct 11 15:06:27 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.229: +2 -2 lines
Diff to previous 1.229 (colored)

Tweak parse_date() again, this time to factor
code in the same way as the other parse_*()
functions. Whitespace fix in comment while
passing. Also conform to idiom that original
data is not changed in the error path.

Revision 1.229 / (download) - annotate - [select for diffs], Mon Oct 9 21:33:11 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.228: +2 -2 lines
Diff to previous 1.228 (colored)

Tweak parse_lease_time() to emit a single message on
failure ("expecting unsigned 32-bit decimal value") and to
properly handle the terminating ';' in error situations.

Make parse_lease_time() return an int to indicate success
or failure as its friends do. Also avoid swapping endianess
twice.

Use == 1 vs != 0 when checking parse_ip_addr() return
value.

Revision 1.228 / (download) - annotate - [select for diffs], Wed Sep 20 15:14:52 2017 UTC (6 years, 8 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.227: +2 -2 lines
Diff to previous 1.227 (colored)

Make send_packet() log entries more informative by
providing the name of the packet type that causes
an error.

Revision 1.227 / (download) - annotate - [select for diffs], Sun Sep 17 21:20:23 2017 UTC (6 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.226: +2 -1 lines
Diff to previous 1.226 (colored)

Create global 'log_procname' and set it to '<ifname>' or
'<ifname> [priv]' as appropriate for the process doing the
setting. Use it as the prefix in all log_*() output. Makes
tracking messages for an interface or a process much easier.

Revision 1.226 / (download) - annotate - [select for diffs], Sat Sep 9 15:07:59 2017 UTC (6 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.225: +3 -3 lines
Diff to previous 1.225 (colored)

Tweak extract_classless_route() to return unsigned int
and accept NULL pointers for unwanted components of
the route.

Revision 1.225 / (download) - annotate - [select for diffs], Tue Aug 29 13:21:30 2017 UTC (6 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.224: +3 -1 lines
Diff to previous 1.224 (colored)

Add a utility function extract_classless_route() and
use it to simplify logic at both places that process
RFC 3442 data.

Revision 1.224 / (download) - annotate - [select for diffs], Mon Aug 28 17:33:42 2017 UTC (6 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.223: +3 -2 lines
Diff to previous 1.223 (colored)

No need for pretty_print_classless() to use
an internal 8K static buffer whose contents
are simply copied into another 8K buffer in
the caller.

Just pass a pointer to and length of the
outer buffer.

Revision 1.223 / (download) - annotate - [select for diffs], Sat Aug 12 17:36:21 2017 UTC (6 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.222: +2 -2 lines
Diff to previous 1.222 (colored)

sig_atomic_t is not (necessarily) an int. Use
SIG_ATOMIC_MAX for INTERNALSIG instead of
INT_MAX.

Revision 1.222 / (download) - annotate - [select for diffs], Thu Aug 10 17:15:05 2017 UTC (6 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.221: +4 -3 lines
Diff to previous 1.221 (colored)

Add IMSG_SET_RESOLV_CONF and keep the cached contents
in the priv process, so that they do not have to be
continually retransmitted. IMSG_WRITE_RESOLV_CONF
now just triggers a write of the cached info.

Simplifies a bunch of logic.

Revision 1.221 / (download) - annotate - [select for diffs], Wed Aug 9 19:57:54 2017 UTC (6 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.220: +1 -2 lines
Diff to previous 1.220 (colored)

Stop obsessively flushing the imsg connection. Just
flush any queued messages on getting a POLLOUT.

Revision 1.220 / (download) - annotate - [select for diffs], Sun Jul 30 14:05:41 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.219: +3 -3 lines
Diff to previous 1.219 (colored)

Use effective_proposal data to set mtu and address.

Revision 1.219 / (download) - annotate - [select for diffs], Sat Jul 29 15:07:47 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.218: +3 -3 lines
Diff to previous 1.218 (colored)

Default routes supplied via DHO_CLASSLESS[_MS]_STATIC_ROUTES
should have the same add_route() logic applied to them as
the one supplied via DHO_ROUTERS. i.e. add the /32 route
if needed, create direct route if gateway address is the
same as interface address.

Simplify logic by using the canonical rtstatic[] version
of static routes created by lease_as_proposal().

Revision 1.218 / (download) - annotate - [select for diffs], Mon Jul 24 18:13:19 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.217: +2 -3 lines
Diff to previous 1.217 (colored)

Throw DHO_STATIC_ROUTES to the floor! Roughly! Ensure
they don't appear in effective leases at all.

Revision 1.217 / (download) - annotate - [select for diffs], Mon Jul 24 17:15:41 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.216: +68 -74 lines
Diff to previous 1.216 (colored)

Shuffle some declarations and functions into the only
files they are used in. Tweak a bunch of whitespace.

Revision 1.216 / (download) - annotate - [select for diffs], Mon Jul 24 13:51:43 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.215: +2 -5 lines
Diff to previous 1.215 (colored)

Move invocations of flush_routes() and delete_addresses() from
bind_lease() into set_routes() and set_address() respectively.

Revision 1.215 / (download) - annotate - [select for diffs], Sat Jul 22 17:55:20 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.214: +3 -1 lines
Diff to previous 1.214 (colored)

Add set_routes() and move bind_lease() route magic
into it. Swap parameter order in add_default_route() to
be consistant with other add_*_route() functions.

Revision 1.214 / (download) - annotate - [select for diffs], Sat Jul 22 14:56:27 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.213: +3 -3 lines
Diff to previous 1.213 (colored)

Rename *_add_address to *_set_address to reflect that the
lease address replaces all current addresses. Shuffle some
code from bind_lease() into set_mtu()/set_address() to
shrink  bind_lease().

Revision 1.213 / (download) - annotate - [select for diffs], Fri Jul 21 18:57:55 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.212: +2 -2 lines
Diff to previous 1.212 (colored)

s/set_interface_mtu/set_mtu/g

Revision 1.212 / (download) - annotate - [select for diffs], Mon Jul 17 15:05:03 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.211: +2 -5 lines
Diff to previous 1.211 (colored)

Remove some magic formerly used to detect the presence of another
dhclient taking control of the interface.

In particular do not exit when addresses are manually added to or
deleted from the interface dhclient(8) is concerned about. Note that
such changes will still be removed whenever dhclient(8) is re-started
or gets a different lease during renewal.

Revision 1.211 / (download) - annotate - [select for diffs], Mon Jul 10 17:13:24 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.210: +4 -3 lines
Diff to previous 1.210 (colored)

Take some of the mystery out of who does what by
renaming "if_register_bpf()" to "get_bpf_sock()",
"if_register_send()" to "get_udp_sock()" and
"if_register_receive()" to "configure_bpf_sock()".

Pull back interface_info knowledge and just pass
the interface name, rdomain and bpf socket fd as
required.

Revision 1.210 / (download) - annotate - [select for diffs], Sun Jul 9 18:45:27 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.209: +2 -1 lines
Diff to previous 1.209 (colored)

Some parsing code cleanup: add parse_boolean(); pass literal format
chars to parse_decimal() instead of less obvious *fmt; refactor
to eliminate need for the 'alloc:' and 'bad_flag:' labels and the
invidious backwards goto's to them.

Revision 1.209 / (download) - annotate - [select for diffs], Sat Jul 8 20:38:31 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.208: +4 -9 lines
Diff to previous 1.208 (colored)

Fold tables.c into options.c and stop exporting the one
table (dhcp_options) involved. Provide functions
code_to_name(), name_to_code(), code_to_format() and
replace direct access to dhcp_options with them. Eliminate
unneeded 'struct option'.

Unhook tables.c from Makefile.

Revision 1.208 / (download) - annotate - [select for diffs], Sat Jul 8 00:36:10 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.207: +12 -12 lines
Diff to previous 1.207 (colored)

Always use uintNN_t instead of sometimes u_intNN_t
and sometimes uintNN_t.

Revision 1.207 / (download) - annotate - [select for diffs], Fri Jul 7 16:58:45 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.206: +9 -9 lines
Diff to previous 1.206 (colored)

Replace the many occurances of '256' with a new #define
DHO_COUNT.

Revision 1.206 / (download) - annotate - [select for diffs], Fri Jul 7 15:14:47 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.205: +2 -2 lines
Diff to previous 1.205 (colored)

assemble_eh_header() needs only to know about hw_addr.

No more struct interface_info knowledge in packet.c

Revision 1.205 / (download) - annotate - [select for diffs], Fri Jul 7 14:53:06 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.204: +3 -4 lines
Diff to previous 1.204 (colored)

Rename cons_options() to pack_options(), and do_packet() to
unpack_options(). Store the unpacked options in a static
variable. Move remaining raw packet processing from unpack_options()
to packethandler().

No more struct interface_info knowledge in options.c

Revision 1.204 / (download) - annotate - [select for diffs], Thu Jul 6 16:56:52 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.203: +2 -2 lines
Diff to previous 1.203 (colored)

cons_options() only needs to know a buffer and a length to
pack options into. Not all the gory details of interface_info.

Move some of the raw packet processing out of options.c's
do_packet() and into the more obvious dispatch.c's
packethandler().

Mention that RFC791 is why we use 576-byte UDP packets.

Revision 1.203 / (download) - annotate - [select for diffs], Wed Jul 5 16:17:42 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.202: +7 -4 lines
Diff to previous 1.202 (colored)

Remove knowledge of struct interface_info from clparse.c. Just
pass the interface name and the TAILQ to put static leases into.

Add a TAILQ for static leases to struct client_config to hold the
static leases until it's time to add them to ifi.

Add add_lease() to add leases to a TAILQ while checking for
leases that are superseded by the new lease.

Revision 1.202 / (download) - annotate - [select for diffs], Sun Jul 2 09:11:13 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.201: +3 -1 lines
Diff to previous 1.201 (colored)

Unbreak tree by putting revised resolv_conf_priority() declaration in
correct place and passing the invocation the correct parameters.

Noticed by & initial diff from matthieu@

Revision 1.201 / (download) - annotate - [select for diffs], Sat Jul 1 23:27:56 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.200: +4 -6 lines
Diff to previous 1.200 (colored)

Eliminate multiple socket openings/closings and pass
fd'd from main loops as required. One socket to do
ioctl's per process (called ioctlfd) and one socket to
do route messages per socket (called routefd).

Clean up local variable declaration lists in passing.

Revision 1.200 / (download) - annotate - [select for diffs], Thu Jun 29 21:37:43 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.199: +1 -2 lines
Diff to previous 1.199 (colored)

Nuke undocumented long-deprecated and/or unsupported lease
fields 'hardware', 'alias', 'media', 'medium', 'ethernet'.

Also remove now-unused parse_ethernet().

Making these parsing failures will smoke out anybody with
leases or conf files from the last century.

Revision 1.199 / (download) - annotate - [select for diffs], Thu Jun 29 13:55:53 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.198: +3 -3 lines
Diff to previous 1.198 (colored)

delete_addresses(), interface_status(), addressinuse(),
lease_as_string() and rewrite_option_db() only use the
interface name, so supply just the name.

Tweak interface_link_forceup() to use the same param
name as other functions taking the interface name.

Revision 1.198 / (download) - annotate - [select for diffs], Wed Jun 28 15:23:19 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.197: +1 -3 lines
Diff to previous 1.197 (colored)

resolv_conf_priority() is a function local to kroute.c, no
need to expose its definition in dhcpd.h. While here change
the parameter from struct interface_info to int and just pass
the only field used (rdomain).

Revision 1.197 / (download) - annotate - [select for diffs], Wed Jun 28 14:35:43 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.196: +1 -2 lines
Diff to previous 1.196 (colored)

Stop trying to clean up addresses, routes and "-L" file
whenever dhclient dies. Eliminates differences in handling
and thus need to intercept signals INT, TERM, USR1,
USR2. Eliminates need for 'zapzombies' field and thus
entire struct imsg_flushroutes. Eliminates need for 'imsg'
parameter to and associated logic in priv_flush_routes().

Address, routes and '-L' file are still cleaned out when
binding a lease.

Revision 1.196 / (download) - annotate - [select for diffs], Tue Jun 27 13:24:49 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.195: +1 -2 lines
Diff to previous 1.195 (colored)

Nuke get_rdomain() and just snag the interface rdomain from the same
ifa we use to get the interface hw address. One less socket() and
ioctl()! MIssed cleanup from shift to just watching RTM_IFINFO
messages for rdomain switch.

Revision 1.195 / (download) - annotate - [select for diffs], Sat Jun 24 23:32:57 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.194: +2 -1 lines
Diff to previous 1.194 (colored)

Tweak handling of HUP and new LLADDR. Just use expose and use sighup()
function. Don't exit dispatch() loop on SIGHUP, wait for privileged
child to execvp() dhclient. Eliminate struct imsg_hup since its
contents were not being used except in priv_cleanup(). And
'active_addr' works just as well there.

Cleaner and eliminates some extraneous log entries.

Revision 1.194 / (download) - annotate - [select for diffs], Sat Jun 24 10:09:26 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.193: +0 -1 lines
Diff to previous 1.193 (colored)

Use a local variable rather than a global flag to record
the reception of a IMSG_HUP message and trigger the
desired restart.

Nuke the now pointless IFI_HUP.

Revision 1.193 / (download) - annotate - [select for diffs], Fri Jun 23 19:51:07 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.192: +1 -2 lines
Diff to previous 1.192 (colored)

Once you have forked into two processes, setting a global flag
in one process does not mean the other process can see the
change. Nuke the pointless IFI_NEW_LLADDR.

Revision 1.192 / (download) - annotate - [select for diffs], Fri Jun 23 15:40:56 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.191: +1 -2 lines
Diff to previous 1.191 (colored)

Take reyk's imsg resolv.conf improvements of a while ago to their
logical conclusion.

Nuke _PATH_RESOLV_CONF since the value is only meant to be
known inside priv_write_resolv_conf(). Just use a local const char *.

Bring priv_write_resolv_conf() into line with other priv_ functions
invoked from the dispatch loop. i.e. don't pass it the imsg, just pass
a pointer to the data and a size after ensuring there is data to pass.

Revision 1.191 / (download) - annotate - [select for diffs], Thu Jun 22 15:08:53 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.190: +1 -3 lines
Diff to previous 1.190 (colored)

Drop support for old (>4yr) timestamp formats in leases
files.

ok tb@ millert@

Revision 1.190 / (download) - annotate - [select for diffs], Wed Jun 21 15:24:34 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.189: +3 -3 lines
Diff to previous 1.189 (colored)

Consistently use time(&var) idiom rather than tossing in a few
var = time(NULL). Flip "struct interface *" to be the first
parameter in set_timeout(), as in other functions taking the
state info.

Revision 1.189 / (download) - annotate - [select for diffs], Sun Jun 18 21:08:15 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.188: +5 -8 lines
Diff to previous 1.188 (colored)

Move the timeout information into struct interface_info with
the rest of the dhcp state. One less struct (dhcp_timeout) to
worry about, one less field (ifi) to keep track of.

Revision 1.188 / (download) - annotate - [select for diffs], Sun Jun 18 17:01:46 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.187: +1 -3 lines
Diff to previous 1.187 (colored)

Convert last set_timeout() use to set_timeout_interval() and
then remove set_timeout() and rename set_timeout_interval() to
set_timeout().

Revision 1.187 / (download) - annotate - [select for diffs], Sun Jun 18 11:21:39 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.186: +1 -2 lines
Diff to previous 1.186 (colored)

Nuke unused pointer to non-existant struct.

Revision 1.186 / (download) - annotate - [select for diffs], Sat Jun 17 17:10:26 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.185: +2 -2 lines
Diff to previous 1.185 (colored)

Rename struct interface_info field 'new' to clearer 'offer'.

Revision 1.185 / (download) - annotate - [select for diffs], Sat Jun 17 16:58:55 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.184: +1 -2 lines
Diff to previous 1.184 (colored)

We accept either the first offer received, or an offer for the
current address if one arrives inside select_timeout. So there
is no need to keep a list of received offers. Just keep the
best one and DECLINE the rest. Nuke now unused 'offered_leases'
TAILQ.

Also fixes the oddity that the *last* offer for the current
address is taken rather than the *first*.

Revision 1.184 / (download) - annotate - [select for diffs], Sat Jun 17 15:53:03 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.183: +1 -2 lines
Diff to previous 1.183 (colored)

DECLINE offers as they are deemed invalid. Decline them at the
first problem rather than continuing to look for other reasons
to decline them. Nuke is_invalid field since it is now unused.
More informative log message when a lease is determined to be
unacceptable.

Revision 1.183 / (download) - annotate - [select for diffs], Fri Jun 16 14:12:12 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.182: +2 -2 lines
Diff to previous 1.182 (colored)

Nuke 'is_bootp' field and just use a #define to check if the lease
has DHO_DHCP_MESSAGE_TYPE info.

Revision 1.182 / (download) - annotate - [select for diffs], Thu Jun 15 17:06:17 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.181: +4 -7 lines
Diff to previous 1.181 (colored)

Nuke unused parameter 'client_addr' from the 'handlers', i.e.
dhcpoffer(), dhcpack(), dhcpnak().

Revision 1.181 / (download) - annotate - [select for diffs], Wed Jun 14 20:27:08 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.180: +8 -6 lines
Diff to previous 1.180 (colored)

No need to be coy - call a "struct interface_info *" a
"struct interface_info *" and not a "void *".

No intentional functional change.

Revision 1.180 / (download) - annotate - [select for diffs], Wed Jun 14 16:52:35 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.179: +5 -8 lines
Diff to previous 1.179 (colored)

Move active, new, offered_leases, leases from
client_state to interface_info.

Nuke empty struct client_state.

No intentional functional change.

Revision 1.179 / (download) - annotate - [select for diffs], Wed Jun 14 16:29:58 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.178: +5 -5 lines
Diff to previous 1.178 (colored)

Move state, destination, interval, requested_address from
client_state to interface_info.

No intentional functional change.

Revision 1.178 / (download) - annotate - [select for diffs], Wed Jun 14 16:09:42 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.177: +5 -5 lines
Diff to previous 1.177 (colored)

Move xid, secs, first_sending, startup_time fields from
client_state to interface_info.

No intentional functional change.

Revision 1.177 / (download) - annotate - [select for diffs], Wed Jun 14 15:57:25 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.176: +4 -4 lines
Diff to previous 1.176 (colored)

Start consolidating client_state into interface_info. First
fields to move: recv_packet, sent_packet and sent_packet_length.

No intentional functional change.

Revision 1.176 / (download) - annotate - [select for diffs], Wed Jun 14 15:39:55 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.175: +21 -22 lines
Diff to previous 1.175 (colored)

No need for two 'flags' fields. Consolidate into one, fixing
value of IFI_HUP while passing.

Revision 1.175 / (download) - annotate - [select for diffs], Tue Jun 13 16:02:46 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.174: +2 -3 lines
Diff to previous 1.174 (colored)

Kill unused #define IFI_NOMEDIA.

Revision 1.174 / (download) - annotate - [select for diffs], Tue Jun 13 15:49:32 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.173: +4 -4 lines
Diff to previous 1.173 (colored)

Rename 'packet' field to 'recv_packet' and 'bootrequest_packet'
field to 'sent_packet'. Also 'bootrequest_packet_length' to
'sent_packet_length'.

Adopt consistent idiom of a local variable 'packet' to point at
packet being manipulated.

No intentional functional change.

Revision 1.173 / (download) - annotate - [select for diffs], Sat Jun 10 18:03:50 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.172: +1 -3 lines
Diff to previous 1.172 (colored)

Nuke unused field bootp_policy and associated enum{}.

Revision 1.172 / (download) - annotate - [select for diffs], Sat Jun 10 17:56:29 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.171: +1 -2 lines
Diff to previous 1.171 (colored)

Nuke unused global warnings_occurred.

Revision 1.171 / (download) - annotate - [select for diffs], Tue Apr 18 13:59:09 2017 UTC (7 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.170: +3 -4 lines
Diff to previous 1.170 (colored)

Tweak parameters to decode_*, add a check or two, and thus gain most of the
sanity improvements reyk@ recently put into dhcrelay to ensure no more than
the captured packet is processed.

Revision 1.170 / (download) - annotate - [select for diffs], Tue Apr 11 10:40:14 2017 UTC (7 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.169: +2 -1 lines
Diff to previous 1.169 (colored)

Fold priv_write_file() into its only remaining user
priv_write_resolv_conf() and move the latter into kroute.c
with all its priv_ friends.

No intentional functional change.

Revision 1.169 / (download) - annotate - [select for diffs], Sat Apr 8 20:16:04 2017 UTC (7 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.168: +4 -4 lines
Diff to previous 1.168 (colored)

Reduce the overburden of signed vs unsigned comparisons by sprinkling
'int' -> 'unsigned int' (and visa versa) where obvious.

Steal a couple of 'unsigned' -> u_int32_t from reyk@'s dhcrelay
tweaks.

No intentional functional change.

Revision 1.168 / (download) - annotate - [select for diffs], Sat Apr 8 18:54:52 2017 UTC (7 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.167: +2 -3 lines
Diff to previous 1.167 (colored)

Replace another snprintf() dance with easier to read code using
strlcat(). Shorter, clearer, fewer signed vs unsigned questions.

Use an 8K static buffer for pretty_print_classless() and use it
rather scribbling intermediate values into the final destination.

No intentional functional change.

Revision 1.167 / (download) - annotate - [select for diffs], Sat Apr 8 17:00:10 2017 UTC (7 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.166: +2 -2 lines
Diff to previous 1.166 (colored)

Replace a mess of snprintf() dances with easier to read code using
strlcat(). Shorter, clearer, fewer signed vs unsigned questions.

Shrink static buffer for the string version of an option value from
32K to 8K. Since the string version of the entire lease is constructed
in a 8K buffer, bigger option values are pointless.

Use 8K of the saved space for a static buffer for pretty_print_string()
and use it rather scribbling intermediate values into the final
destination.

No intentional functional change.

Revision 1.166 / (download) - annotate - [select for diffs], Fri Apr 7 15:03:00 2017 UTC (7 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.165: +2 -3 lines
Diff to previous 1.165 (colored)

Simply decoding of domain search option. No intentional functional
change.

Revision 1.165 / (download) - annotate - [select for diffs], Wed Apr 5 18:22:30 2017 UTC (7 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.164: +1 -3 lines
Diff to previous 1.164 (colored)

Shuffle sendhup() into dispatch.c, the only place it is used.

Revision 1.164 / (download) - annotate - [select for diffs], Tue Apr 4 15:15:48 2017 UTC (7 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.163: +2 -1 lines
Diff to previous 1.163 (colored)

Send a RTM_PROPOSAL to clear out other dhclient instances on startup.

Replaces forcing interface link state down and up to generate
RTM_IFINFO messages.

Revision 1.163 / (download) - annotate - [select for diffs], Tue Apr 4 13:01:20 2017 UTC (7 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.162: +5 -3 lines
Diff to previous 1.162 (colored)

Treat SSID's like the 0 to 32 bytes of uint8_t data that they really
are. Track and use the actual lengths and use memcpy()/memcmp()
instead of strcmp()/strdup().

Revision 1.162 / (download) - annotate - [select for diffs], Mon Apr 3 19:59:39 2017 UTC (7 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.161: +2 -2 lines
Diff to previous 1.161 (colored)

Change parse_string() to take an optional integer pointer that can
be used to return the final size of the parsed (i.e. un-vis'ed)
string. Use same, plus memcpy() to ensure entire final string is
copied to intended destination even if there are embedded NULs.

Revision 1.161 / (download) - annotate - [select for diffs], Wed Mar 8 20:33:20 2017 UTC (7 years, 2 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.160: +4 -4 lines
Diff to previous 1.160 (colored)

Shuffle, shuffle, shuffle.

Revision 1.160 / (download) - annotate - [select for diffs], Sun Feb 12 13:15:50 2017 UTC (7 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.159: +2 -10 lines
Diff to previous 1.159 (colored)

Switch from 'legacy' errwarn.c to standard daemon logging functions.

No objections heard. Feedback from millert@ guenther@

Revision 1.159 / (download) - annotate - [select for diffs], Sat Feb 11 16:12:36 2017 UTC (7 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.158: +2 -2 lines
Diff to previous 1.158 (colored)

Move parse_warning() into parse.c to prepare to replace errwarn.c
with standard daemon log.[ch].

ok mpi@

Revision 1.158 / (download) - annotate - [select for diffs], Fri Sep 2 15:44:26 2016 UTC (7 years, 9 months ago) by mpi
Branch: MAIN
Changes since 1.157: +12 -8 lines
Diff to previous 1.157 (colored)

Kill 'ifi' global.

ok henning@, krw@

Revision 1.157 / (download) - annotate - [select for diffs], Wed Aug 31 12:57:31 2016 UTC (7 years, 9 months ago) by mpi
Branch: MAIN
Changes since 1.156: +3 -3 lines
Diff to previous 1.156 (colored)

Remove the 'client' global and make it per-ifp.

ok krw@

Revision 1.156 / (download) - annotate - [select for diffs], Tue Aug 23 09:26:02 2016 UTC (7 years, 9 months ago) by mpi
Branch: MAIN
Changes since 1.155: +16 -15 lines
Diff to previous 1.155 (colored)

Make the 'ifi' global local to dhclient.c and pass it as an argument to
functions needing it.

This is the first step to support multiple interfaces in one dhclient(8)
instance.

ok krw@

Revision 1.155 / (download) - annotate - [select for diffs], Tue Aug 16 21:57:51 2016 UTC (7 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.154: +3 -1 lines
Diff to previous 1.154 (colored)

Track SSID in leases file and only consider leases from the current SSID when
starting up dhclient on wifi interfaces. In theory will preserve leases from
other SSID's and speed up obtaining a lease by not wasting time attempting
to re-acquire a lease from a different SSID.

Experimental feature from n2k16 needing some real world testing before g2k16.

Revision 1.154 / (download) - annotate - [select for diffs], Sat Feb 6 19:30:52 2016 UTC (8 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.153: +1 -34 lines
Diff to previous 1.153 (colored)

Eliminate #include inside *.h files and include only needed headers in
each *.c file.

Inspired by mention of header silliness by Edgar Pettijohn and mmcc@
on tech@.

Revision 1.153 / (download) - annotate - [select for diffs], Sat Dec 12 14:48:17 2015 UTC (8 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.152: +4 -3 lines
Diff to previous 1.152 (colored)

Send DECLINE messages in response to ACK messages that turn out to
have inadequate or invalid leases. In particular leases for addresses
that are already configured on a different interface. After the
DECLINE, return to INIT state and start looking for a valid lease. This
conforms much closer to the relevant RFC's.

Avoids 'hanging' dhclient(8) during boot when the attempt to configure
the address fails without dhclient(8) realizing it.

Issue found and various fixes tested by mpi@. Feedback from beck@ and
reyk@.

ok mpi@

Revision 1.152 / (download) - annotate - [select for diffs], Mon Oct 26 16:32:33 2015 UTC (8 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.151: +3 -1 lines
Diff to previous 1.151 (colored)

Give dhclient(8) the ability to use option 119, a.k.a. "Domain
Search" if supplied by the server.

Requested by a few. Original diff from Ray Lai via tech@.

Tested & ok claudio@

Revision 1.151 / (download) - annotate - [select for diffs], Wed Aug 19 17:52:10 2015 UTC (8 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.150: +3 -1 lines
Diff to previous 1.150 (colored)

Missing prototypes. Noted by deraadt@

Revision 1.150 / (download) - annotate - [select for diffs], Mon May 18 14:59:42 2015 UTC (9 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.149: +1 -2 lines
Diff to previous 1.149 (colored)

Stop rejecting leases with a subnet that overlaps a subnet already
present. The latest routing stack code can now handle these situations.

Much requested by beck@ and others. Detailed discussion at s2k15
identified required routing changes.

ok claudio@

Revision 1.149 / (download) - annotate - [select for diffs], Tue Feb 10 04:20:26 2015 UTC (9 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.148: +3 -2 lines
Diff to previous 1.148 (colored)

Groundwork for better route support over multiple interfaces by
using RTM_IFA to bind routes to an interface. Keep the subnet route
conflict avoidance code for the time being.

diff from claudio@ as part of larger routing magic diff.

ok claudio@ mpi@

Revision 1.148 / (download) - annotate - [select for diffs], Sat Feb 7 02:07:32 2015 UTC (9 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.147: +8 -7 lines
Diff to previous 1.147 (colored)

GC unused parameters now that ifname and rdomain are not used in
constructing imsgs.

ok reyk@

Revision 1.147 / (download) - annotate - [select for diffs], Fri Jan 16 06:39:56 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.146: +2 -1 lines
Diff to previous 1.146 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.146 / (download) - annotate - [select for diffs], Wed Dec 10 02:34:03 2014 UTC (9 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.145: +6 -4 lines
Diff to previous 1.145 (colored)

Reusing the same field for different things in different contexts may
be clever, but it is definitely confusing. Use a flag IFI_VALID_LLADDR
to indicate that the ifi->hw_address field is valid, rather than
assuming ifi->linkstat does that. Add startup_time to record client
startup rather than using first_sending and hoping nobody else needs
it until link is complete.

Revision 1.145 / (download) - annotate - [select for diffs], Fri Dec 5 15:47:05 2014 UTC (9 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.144: +2 -1 lines
Diff to previous 1.144 (colored)

Move initial wait for network link into the state machine by adding
state S_PREBOOT and associated state_preboot() function.

This results in routing socket messages being processed even while
the link is being waited for. Thus the RTM_IFINFO message announcing
the link is ready can be reacted to immediately, rather than waiting
for the sleep(1)'ing process to wake up and look at the link state.

Some interfaces seem to lose the first packet sent when the RTM_IFINFO
message is reacted to so quickly, so temporarily leave in place an
explicit delay before sending the first packet.

Revision 1.144 / (download) - annotate - [select for diffs], Sun Nov 23 18:22:45 2014 UTC (9 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.143: +2 -2 lines
Diff to previous 1.143 (colored)

Rename discover_interface() to more meaningful get_hw_address().

Hoist one-time initialization of client identifier out of
get_hw_address() to the one-time initialization code in main().

No intentional functional change.

Revision 1.143 / (download) - annotate - [select for diffs], Sun Nov 23 14:02:21 2014 UTC (9 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.142: +4 -7 lines
Diff to previous 1.142 (colored)

Cleanup some struct interface_info fields. Make 'nomedia' a flag. Replace
the two copies of the bpf socket descriptor (rfdesc, wfdesc) with
just one (bfdesc). No need to keep a struct ifreq (ifp) since it's
only used once and can be constructed there and discarded. Nuke
unused 'primary_address' member.

No intentional functional change.

Revision 1.142 / (download) - annotate - [select for diffs], Sat Nov 1 15:49:07 2014 UTC (9 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.141: +1 -4 lines
Diff to previous 1.141 (colored)

Try to ensure that the various lease timeouts are sane. i.e., renew
is before rebind is before expiry. Don't allow lease expiry to be
set past the end of time, but do allow lease lengths >INT32_MAX.

Tweak default times to be more reliably in-line with RFCs.

Nuke getULong(), the last function in convert.c, since its last
uses were in this now re-written code.

Suspicions aroused while diagnosing the expiry problem weerd@ found.

Revision 1.141 / (download) - annotate - [select for diffs], Wed Oct 29 15:28:51 2014 UTC (9 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.140: +1 -2 lines
Diff to previous 1.140 (colored)

Calling a function to htonl() a constant 32-bit value into a stack
variable and memcpy() that value into 4 bytes of malloc()'d space
seems roundabout.

Just memcpy() a four byte constant string into the malloc()'d space
as required and kill putULong(). No functional change.

Revision 1.140 / (download) - annotate - [select for diffs], Mon Oct 27 17:01:28 2014 UTC (9 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.139: +1 -4 lines
Diff to previous 1.139 (colored)

Nuke getLong(), getShort(), getUShort(). Two line functions (memcpy();
ntoh[ls]()) obscure rather than simplify things. Especially when
they are used only once. Just use the expansion.

Revision 1.139 / (download) - annotate - [select for diffs], Fri May 23 15:26:22 2014 UTC (10 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.138: +1 -2 lines
Diff to previous 1.138 (colored)

A #define to rename another #define which is then used only once introduces
more obscurity than clarity. Nuke DHCPD_LOG_FACILITY and just use
LOG_DAEMON in openlog() call.

Revision 1.138 / (download) - annotate - [select for diffs], Wed Apr 30 15:11:00 2014 UTC (10 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.137: +2 -2 lines
Diff to previous 1.137 (colored)

Preserve intended chronological order of leases in
dhclient.leases.<if> files by writing out in reverse the
reverse-chronological-order TAILQ client->leases.

Found while trying to restore static lease functionality.

Revision 1.137 / (download) - annotate - [select for diffs], Thu Apr 17 09:59:30 2014 UTC (10 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.136: +3 -3 lines
Diff to previous 1.136 (colored)

Eliminate a couple of always-NULL parameters. Eliminate some
pointless repetition of well-known info in log messages. Pass
around smaller bits of info. Make 'inaddr_any' a const struct
initialized with { INADDR_ANY }.

Tweaks and ok guenther@

Revision 1.136 / (download) - annotate - [select for diffs], Sun Feb 9 20:45:56 2014 UTC (10 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.135: +3 -1 lines
Diff to previous 1.135 (colored)

Don't use imsg_flush(), roll a local flush_unpriv_ibuf() that loops
on EAGAIN, sets quit to INTERNALSIG on errors (unless quit is already
set to something else), and prints a consistant error message when
errors other than EPIPE and end of file are encountered.

Fixes failure to write resolv.conf when -L is used, and makes
add_address() and add_route() also wait until imsg is in pipe.

Revision 1.135 / (download) - annotate - [select for diffs], Tue Jan 21 05:17:45 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.134: +5 -1 lines
Diff to previous 1.134 (colored)

Allow dhclient.conf to specify 'fixed-address', 'next-server',
'filename' and 'server-name'. dhclient.conf can now override anything
in an offer or saved lease when creating the effective lease.

Revision 1.134 / (download) - annotate - [select for diffs], Tue Jan 21 03:07:50 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.133: +2 -1 lines
Diff to previous 1.133 (colored)

Add parsing for options 121 (classless-static-routes) and 249
(classless-ms-static-routes). dhcpd can now specify and serve
these options and dhclient can recognize and use supersede, etc.
statements on them.

Based on a diff from Stefan Rinke. Thanks!

Revision 1.133 / (download) - annotate - [select for diffs], Sun Jan 19 10:06:09 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.132: +1 -4 lines
Diff to previous 1.132 (colored)

Nuke unused functions putLong(), putUShort(), putShort().

Revision 1.132 / (download) - annotate - [select for diffs], Sun Jan 19 08:25:54 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.131: +3 -2 lines
Diff to previous 1.131 (colored)

Redo the parsing of numbers to improve the error messages and
make the code more readable. And prepare for some new things
that will need to be parsed.

ok dlg@

Revision 1.131 / (download) - annotate - [select for diffs], Sun Jan 19 04:36:04 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.130: +2 -2 lines
Diff to previous 1.130 (colored)

Rename parse_hardware_param() to parse_ethernet() to reflect what
it actually does.

Revision 1.130 / (download) - annotate - [select for diffs], Mon Jan 13 02:38:52 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.129: +5 -5 lines
Diff to previous 1.129 (colored)

warning(), note(), debug(), parse_warn() always return 0, which no
caller checks or saves. So just void them all.

Revision 1.129 / (download) - annotate - [select for diffs], Sun Jan 12 04:17:36 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.128: +2 -2 lines
Diff to previous 1.128 (colored)

Since the return value of read_client_conf() is not checked, don't
bother returning one.

Revision 1.128 / (download) - annotate - [select for diffs], Mon Dec 30 03:36:17 2013 UTC (10 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.127: +3 -3 lines
Diff to previous 1.127 (colored)

Replace yet another hand-rolled list with a TAILQ. reject_list this
time.

Revision 1.127 / (download) - annotate - [select for diffs], Sat Dec 21 18:23:10 2013 UTC (10 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.126: +2 -1 lines
Diff to previous 1.126 (colored)

Introduce pretty_print_string() and use for printing both text
valued options and previously snprintf()'d filename and servername
lease attributes.

Should fix "string constant too long" errors when reading back a
lease with filename or servername attributes with escaped characters.

Reported by Rivo Nurges.

Revision 1.126 / (download) - annotate - [select for diffs], Thu Dec 12 00:22:06 2013 UTC (10 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.125: +4 -4 lines
Diff to previous 1.125 (colored)

Assemble outgoing packets using iovec to combine the (optional)
ethernet header, the ip header, the udp header and the packet.
Rather than manually concatenating the headers and then using iovec
to bundle in the packet. Eliminates some memcpy()s and convoluted
data copying.

Revision 1.125 / (download) - annotate - [select for diffs], Fri Dec 6 23:40:48 2013 UTC (10 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.124: +8 -14 lines
Diff to previous 1.124 (colored)

Having stopped pretending we handle anything but ethernet packets,
replace the 'struct hardware' abstraction layer and use 'struct
ether_addr' where hardware addresses are of interest.

ok matthew@, confirmed by reyk@ not to impact DHCP-over-IPSec support.

Revision 1.124 / (download) - annotate - [select for diffs], Tue Nov 19 15:12:23 2013 UTC (10 years, 6 months ago) by mikeb
Branch: MAIN
Changes since 1.123: +2 -1 lines
Diff to previous 1.123 (colored)

include queue.h directly instead of relying on if.h to provide it;
ok deraadt

Revision 1.123 / (download) - annotate - [select for diffs], Mon Nov 11 21:00:01 2013 UTC (10 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.122: +5 -37 lines
Diff to previous 1.122 (colored)

Shuffle function prototypes and extern declarations around to
put local functions prototypes and variables in their .c files, and
cross-file functions into .h files. Prompted by deraadt@.

Revision 1.122 / (download) - annotate - [select for diffs], Tue Oct 22 18:15:58 2013 UTC (10 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.121: +2 -1 lines
Diff to previous 1.121 (colored)

Save 'next-server' (a.k.a. siaddr) info in leases file. Saving the
file name without the server address seems silly.

Tested & ok uwe@

Revision 1.121 / (download) - annotate - [select for diffs], Sun Jun 9 22:39:51 2013 UTC (10 years, 11 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.120: +2 -2 lines
Diff to previous 1.120 (colored)

Make route adding interface more flexible by passing flags to be
used rather than deducing them. Use priv_add_route() to add
the 127.0.0.1 address when adding an address.

Revision 1.120 / (download) - annotate - [select for diffs], Sun Jun 9 15:06:34 2013 UTC (10 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.119: +2 -2 lines
Diff to previous 1.119 (colored)

Re-apply route adding code refactoring -- it wasn't the problem that
broke populating the egress group.

Revision 1.119 / (download) - annotate - [select for diffs], Sun Jun 9 00:30:06 2013 UTC (10 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.118: +1 -1 lines
Diff to previous 1.118 (colored)

Backout static/classless route handling and default route refactoring
since the former relies on the latter and the latter breaks 'egress'
group populating.

Revision 1.118 / (download) - annotate - [select for diffs], Sat Jun 1 16:26:07 2013 UTC (11 years ago) by krw
Branch: MAIN
Changes since 1.117: +2 -2 lines
Diff to previous 1.117 (colored)

Refactor the default route adding code to use a general route adding
function that will be reused for future work.

ok claudio@

Revision 1.117 / (download) - annotate - [select for diffs], Sun May 5 16:45:01 2013 UTC (11 years ago) by krw
Branch: MAIN
Changes since 1.116: +3 -1 lines
Diff to previous 1.116 (colored)

Add a flag to struct client_state (IS_RESPONSIBLE) to record when
the first expected RTM_NEWADDR arrives, which signals that a lease
has been bound to the interface. Ignore RTM_NEWADDR and RTM_DELADDR
messages until the flag has been set.

Makes it more likely that the last dhclient started will be the
last dhclient standing. Fixes the problem reported by David Higgs,
where restarting an install in a vm consistantly caused the new
dhclient to be the one that dies.

Revision 1.116 / (download) - annotate - [select for diffs], Thu May 2 16:35:27 2013 UTC (11 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.115: +2 -2 lines
Diff to previous 1.115 (colored)

Bunch of comment/whitespace cleanup. Eliminate some misleading or
pointless ones, make multiline comments readable, nuke '...' in
favour of '.', etc.

Revision 1.115 / (download) - annotate - [select for diffs], Thu May 2 14:48:35 2013 UTC (11 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.114: +4 -4 lines
Diff to previous 1.114 (colored)

Enough of the hand-rolling of queues. Turn client->leases and
client->offered_leases into TAILQs.

Revision 1.114 / (download) - annotate - [select for diffs], Sat Apr 27 17:54:24 2013 UTC (11 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.113: +4 -1 lines
Diff to previous 1.113 (colored)

Use same parse_date() and date writing logic as in dhcpd. i.e.
strptime() rather than handrolling parsing. Change date format
in leases to same as dhcpd, fixing 'u' vs 'w' error made in
initial strftime() introduction.

Revision 1.113 / (download) - annotate - [select for diffs], Fri Apr 5 19:19:05 2013 UTC (11 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.112: +2 -2 lines
Diff to previous 1.112 (colored)

Nuke parameter to do_packet() not used since 2006. From dhill.

Revision 1.112 / (download) - annotate - [select for diffs], Sat Mar 30 16:10:01 2013 UTC (11 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.111: +2 -2 lines
Diff to previous 1.111 (colored)

Since deleting all the addresses on an interface removes all the
relevant entries from the arp cache, don't bother asking for/processing
arp entries in the route dumps. Thus allowing use of NET_RT_FLAGS
with RTF_GATEWAY and AF_INET, to ask for only the routes dhclient
wants to expunge rather than all routes in existance.

Greatly shrinks and simplifies the code. No intentional functional
change. Tested by sthen@.

Revision 1.111 / (download) - annotate - [select for diffs], Mon Feb 18 15:57:08 2013 UTC (11 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.110: +5 -2 lines
Diff to previous 1.110 (colored)

Rework log messages to be more useful. Rename
IMGS_CLEANUP/imsg_cleanup/cleanup to IMSG_HUP/imsg_hup/sendhup to
more accurately reflect intent of causing the privileged process
to initiate restart.

There should now be one and only one message logged at termination
or restart, logged by the process initiating the termination or
restart.

As part of fixing this, remove duplicate cleanup attempts and exit
after sending IMSG_HUP. These make logged messages more consistant and
fix issues with incorrect cleanups.

More prodding from deraadt@

Revision 1.110 / (download) - annotate - [select for diffs], Sun Feb 17 17:36:31 2013 UTC (11 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.109: +2 -1 lines
Diff to previous 1.109 (colored)

Using the value SIGQUIT to cause the dispatch loops to exit produced
universal revulsion and no little confusion.  #define our own value,
currently INT_MAX, which should not overlap any likely signal value.

Revision 1.109 / (download) - annotate - [select for diffs], Thu Feb 14 20:39:46 2013 UTC (11 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.108: +3 -2 lines
Diff to previous 1.108 (colored)

Don't rely on the packet buffer (client->packet) being preserved between
attempts to send DISCOVER or REQUEST packets. Some DHCP servers might
NAK the DISCOVER, or other nefarious packets arrive, between attempts
and overwrite the packet being sent. Create and use another buffer
for packets being sent.

Problem encountered by fgsch@, who noticed that once the DISCOVER was
NAK'ed our dhclient sent a bunch of NAK's back to the server. Like it
thought they were DISCOVER messages.

ok beck@

Revision 1.108 / (download) - annotate - [select for diffs], Sun Feb 3 21:04:19 2013 UTC (11 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.107: +2 -2 lines
Diff to previous 1.107 (colored)

Remove unused (a.k.a. always passed NULL) parameter 'data' from
decode_udp_ip_header() and the useless check of it. Part of original
diff from pelikan about udp length errors.

Revision 1.107 / (download) - annotate - [select for diffs], Sun Jan 27 02:45:46 2013 UTC (11 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.106: +2 -1 lines
Diff to previous 1.106 (colored)

Refactor code a bit. Calculate resolv.conf contents once when binding a
lease and reuse as required whenever resolv.conf is written. Use
write_file() rather than a custom message/functions to write out
resolv.conf.

Revision 1.106 / (download) - annotate - [select for diffs], Sat Jan 26 05:07:21 2013 UTC (11 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.105: +2 -1 lines
Diff to previous 1.105 (colored)

Read /etc/resolv.conf.tail once on startup and save contents for
application during subsequent resolv.conf building.

Revision 1.105 / (download) - annotate - [select for diffs], Sat Jan 26 04:11:39 2013 UTC (11 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.104: +34 -34 lines
Diff to previous 1.104 (colored)

Whitespace tweaks.

Revision 1.104 / (download) - annotate - [select for diffs], Fri Jan 18 05:50:32 2013 UTC (11 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.103: +4 -2 lines
Diff to previous 1.103 (colored)

Add command line option '-L' that specifies an optional file into which
the most recent offer and effective leases will be written. Intended
to allow access to dhcp option information that was formerly
passed to dhclient-script.

Revision 1.103 / (download) - annotate - [select for diffs], Thu Jan 17 23:41:07 2013 UTC (11 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.102: +2 -2 lines
Diff to previous 1.102 (colored)

Try harder to clear out default routes on the interface being
configured. Only exempt default routes labelled as being the
property of another dhclient.

Revision 1.102 / (download) - annotate - [select for diffs], Wed Jan 16 21:35:41 2013 UTC (11 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.101: +4 -4 lines
Diff to previous 1.101 (colored)

Unrevert last reversion. otto@ pointed out that it wasn't asprintf()
causing a problem, it was accessing uninitialized pointers.

Revision 1.101 / (download) - annotate - [select for diffs], Wed Jan 16 11:02:09 2013 UTC (11 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.100: +4 -4 lines
Diff to previous 1.100 (colored)

Revert last. asprintf() breaks something.

Revision 1.100 / (download) - annotate - [select for diffs], Wed Jan 16 06:11:21 2013 UTC (11 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.99: +4 -4 lines
Diff to previous 1.99 (colored)

Use the magic of asprintf() to produce more informative error
and log messages.

Revision 1.99 / (download) - annotate - [select for diffs], Sat Jan 5 20:34:17 2013 UTC (11 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.98: +2 -2 lines
Diff to previous 1.98 (colored)

Change write_client_lease() into lease_as_string() and modify
rewrite_client_leases() to use lease_as_string(), writing out
complete leases at a time.

While here replace hand formatting of dates with strftime(). This
will add leading zeros to months and days, but not affect the
ability of dhclient to parse the resulting files.

Revision 1.98 / (download) - annotate - [select for diffs], Wed Dec 19 12:25:38 2012 UTC (11 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.97: +2 -1 lines
Diff to previous 1.97 (colored)

Don't attempt to delete an address that has already been deleted
by a new dhclient (or anyone else). Instead, use add_address(...,
INADDR_ANY, ...) to tell the privileged process that its active
address is gone. Thus the cleanup process doesn't try to delete it.

Eliminates extraneous log entries complaining that the address can't
be deleted. Narrows race window where old dhclient might delete the
address the new dhclient has just added.

Make rapid-fire starting of dhclient even more reliable.

Revision 1.97 / (download) - annotate - [select for diffs], Tue Dec 4 19:24:03 2012 UTC (11 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.96: +2 -2 lines
Diff to previous 1.96 (colored)

Eliminate hand-rolled pseudo-strerror() %m strangeness by replacing
all occurances of %m with strerror(errno). And then nuking do_percentm()
and related buffer shuffling.

Also simplify parse_warn() so it takes a simple char * of the error,
and thus rely on pointing to error location in input for details.

Makes sense to beck@

Revision 1.96 / (download) - annotate - [select for diffs], Sun Dec 2 17:03:19 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.95: +4 -1 lines
Diff to previous 1.95 (colored)

Try harder to cleanup when exiting. In particular catch signals
SIGHUP, SIGINT, SIGTERM, SIGUSR1, SIGUS2 and cleanup before exiting
when getting them. Cleanup meaning removing routes and the interface
address added.

Tweaks and feedback from phessler@, sthen@, otto@, deraadt@

Revision 1.95 / (download) - annotate - [select for diffs], Tue Nov 27 15:51:48 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.94: +3 -2 lines
Diff to previous 1.94 (colored)

Clean up parsing of option lists. Part 6.

Treat 'ignore' option lists the same as 'request' and 'require'
option lists. i.e.  keep a list of the options rather than using
an ACTION flag. So overriding a previous ignore list will not leave
breadcrumbs and incorrect ACTIONs lying around.

The list will be applied when the new lease is created, and will
override any ACTION specified for the option.

Mention in dhclient.conf(5) that each request/require/ignore statement
will override any previous one.

Revision 1.94 / (download) - annotate - [select for diffs], Sun Nov 25 12:49:56 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.93: +3 -2 lines
Diff to previous 1.93 (colored)

Clean up parsing of option lists. Part 1.

1) Add config->required_options_count so that syntactically incorrect
request statement in dhclient.conf is completely ignored.
2) Pass size of buffer being filled instead of assuming 256.
3) Always zero (a.k.a. DHO_PAD) the passed in buffer.
4) Check for out of bounds index before using it, not after.

Add TOK_IGNORE to syntax in comment.

No intentional functional change other than catching bad request
statements.

Revision 1.93 / (download) - annotate - [select for diffs], Fri Nov 23 15:25:47 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.92: +2 -8 lines
Diff to previous 1.92 (colored)

Use the libutil imsg framework rather than a hand-rolled local
version. This is the last hand-rolled imsg implementation I could
spot. Doesn't seem to break sparc64.

Suggested by chris@, tweaks from brad@ and reyk@.

ok reyk@

Revision 1.92 / (download) - annotate - [select for diffs], Wed Nov 14 15:47:41 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.91: +7 -7 lines
Diff to previous 1.91 (colored)

Remove useless _new_ and _old_ from various function names to make
them shorter and eliminate implications about what the function
does. No functional change.

Revision 1.91 / (download) - annotate - [select for diffs], Thu Nov 8 21:32:55 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.90: +22 -31 lines
Diff to previous 1.90 (colored)

Remove confusing extra address abstraction 'struct iaddr'. Just use
'in_addr'. Remove many double conversions and other perversions.
piaddr() replaced with inet_ntoa(). dhclient is extremely unlikely
to support anything but ipv4/dhcp without a complete rewrite.

Joint work with chris@.

Positive feedback from deraadt@ zinke@ phessler@.

Revision 1.90 / (download) - annotate - [select for diffs], Wed Nov 7 17:42:52 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.89: +1 -7 lines
Diff to previous 1.89 (colored)

Nuke unused struct and function declarations.

Revision 1.89 / (download) - annotate - [select for diffs], Wed Nov 7 15:40:13 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.88: +2 -2 lines
Diff to previous 1.88 (colored)

Always memcpy() into/out of option data rather than hoping the char *
will be always be aligned. Don't pass around pointers into option
data - use variable that has the memcpy()'d data.

Revision 1.88 / (download) - annotate - [select for diffs], Tue Nov 6 00:05:11 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.87: +1 -3 lines
Diff to previous 1.87 (colored)

Kill two unused functions, subnet_number() and broadcast_addr().

Revision 1.87 / (download) - annotate - [select for diffs], Sun Nov 4 03:36:39 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.86: +3 -3 lines
Diff to previous 1.86 (colored)

No need to pass interface name around when flushing routes.

Revision 1.86 / (download) - annotate - [select for diffs], Sun Nov 4 03:25:31 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (colored)

No need to pass interface name around when creating routes.

Revision 1.85 / (download) - annotate - [select for diffs], Sat Nov 3 16:54:34 2012 UTC (11 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.84: +2 -2 lines
Diff to previous 1.84 (colored)

Various fixes/tweaks for resolv.conf handling:

1) Don't leak a file descriptor if there are no contents for
resolv.conf.
2) Allow for only resolv.conf.tail to go into resolv.conf.
3) Don't need to pass around interface name when creating resolv.conf.
4) Don't leave 0 length resolv.conf lying around if there are no
contents.

Revision 1.84 / (download) - annotate - [select for diffs], Wed Oct 31 15:50:47 2012 UTC (11 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.83: +7 -6 lines
Diff to previous 1.83 (colored)

Forcibly delete all existing ipv4 addresses from an interface when
binding a lease to that interface. This fixes issues sthen@ found
with unexpectedly persistant addresses and failures of dhclient
when switching an interface repeatedly between different networks.

This crude but predictable behaviour may be toned down once it
is figured out what we want to do with mixed static/dynamic
configurations on an interface.

ok sthen@

Revision 1.83 / (download) - annotate - [select for diffs], Tue Oct 30 18:39:44 2012 UTC (11 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.82: +21 -18 lines
Diff to previous 1.82 (colored)

Nuke dhclient-script and dhclient.conf 'script' directive. Do all
interface and route configuration via ioctl's and routing sockets.

This will break configurations using local enhancements of
dhclient-script, which will now require alternate arrangements.

Committing early to allow time to identify and develop required
alternatives.

Several proddings by deraadt@.

Revision 1.82 / (download) - annotate - [select for diffs], Sat Oct 27 23:08:53 2012 UTC (11 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (colored)

Change dhclient.conf directive 'ignore' to take a list of option names
rather than list of option declarations. e.g. 'ignore routers;'
instead of 'ignore routers 1.2.3.4;' The value in the declaration
was being ignored anyway.

While there clean up the related code a bit.

Revision 1.81 / (download) - annotate - [select for diffs], Tue Sep 18 09:34:09 2012 UTC (11 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.80: +2 -1 lines
Diff to previous 1.80 (colored)

Don't accept leases that offer a subnet that is already configured
on an interface. Crude hammer that may be refined as needed.

Feedback from tedu@, beck@, sthen@ claudio@

Revision 1.80 / (download) - annotate - [select for diffs], Sat Sep 1 19:08:42 2012 UTC (11 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.79: +1 -2 lines
Diff to previous 1.79 (colored)

Oops. Missed a reinitialize_interface() declaration.

Revision 1.79 / (download) - annotate - [select for diffs], Sun Aug 26 23:33:30 2012 UTC (11 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

Junk global cur_time, and use time(NULL) or local variables where
time is checked multiple times. Add a set_timeout_interval() function
to allow setting a timeout based on an interval from current time.

Fixes issues with initial startup where the global cur_time was
always old and caused initial DHCPDISCOVER or DHCPREQUEST packets
to be sent multiple times. And probably other timeout related
oddities.

Tested by naddy@

Revision 1.78 / (download) - annotate - [select for diffs], Wed Aug 22 00:14:42 2012 UTC (11 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.77: +2 -1 lines
Diff to previous 1.77 (colored)

add ignore keyword to conf file, allowing one to ignore unwanted info
from the server without necessarily speciyfing a supersede value

Revision 1.77 / (download) - annotate - [select for diffs], Sat Aug 18 00:23:30 2012 UTC (11 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.76: +1 -2 lines
Diff to previous 1.76 (colored)

Remove unused field 'next' from struct timeout. There's only one
timeout now, not a list.

Revision 1.76 / (download) - annotate - [select for diffs], Mon Jul 9 16:21:21 2012 UTC (11 years, 10 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.75: +3 -3 lines
Diff to previous 1.75 (colored)

Terminate with extreme prejudice the multiple timeout queuing
mechanism that was a holdover from when dhclient handled multiple
interfaces at once. There is only one timeout possible at a time.

Also move calculation of current time to just before check to see
if the timeout has expired.

ok beck@ guenther@

Revision 1.75 / (download) - annotate - [select for diffs], Sun Jun 24 16:01:18 2012 UTC (11 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.74: +1 -2 lines
Diff to previous 1.74 (colored)

Nuke interface_link_status() (check media status only) and use
interface_status() (check IFF_UP|IFF_RUNNING and media status). The
interface is forced up when dhclient starts so the flags should be
correct.

Thanks to guenther@ for pointing out the original raison d'etre of
the difference between the two.

Revision 1.74 / (download) - annotate - [select for diffs], Sat Dec 10 15:55:43 2011 UTC (12 years, 5 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.73: +2 -2 lines
Diff to previous 1.73 (colored)

Tweak leases file handling.

1) Write out new leases file every time a lease is obtained. i.e. don't
append 20 leases before cleaning it up.

2) Write new leases file after calling dhclient-script to implement
new info. Gets interface configured first, and makes it more likely
the leases file reflects most current configuration.

Revision 1.73 / (download) - annotate - [select for diffs], Wed May 11 14:38:36 2011 UTC (13 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.72: +2 -2 lines
Diff to previous 1.72 (colored)

Make dhclient more friendly to sequential option processing by
always starting DHCP packet options with DHO_DHCP_MESSAGE_TYPE. Now
DHCP-specific options always come after the option identifying the
packet as DHCP rather than BOOTP. Makes at least Nortel NetIP DHCP
server happier. Clean up some code and parameter passing.

Closes PR#6543, as confirmed by original submitter and patch
tester Len Zaifman. Thanks!

ok matthew@ (who hates the ISC-like code)

Revision 1.72 / (download) - annotate - [select for diffs], Mon Apr 4 11:14:52 2011 UTC (13 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.71: +3 -8 lines
Diff to previous 1.71 (colored)

Dump some useless calls to dhclient-script. i.e. MEDIUM, PREINIT,
ARPSEND, ARPCHECK. Drop support for 'media', 'medium' and 'alias'
specifications in dhclient.conf. Old leases still parse but these
options now have no effect.

Be more polite and decline all offers we don't accept. Fix a IMSG
length check.

Many expressions of support at various bars.

ok henning@ deraadt@ beck@

Revision 1.71 / (download) - annotate - [select for diffs], Fri Jul 2 22:03:27 2010 UTC (13 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.70: +1 -2 lines
Diff to previous 1.70 (colored)

garbage collect an unused function; ok claudio

Revision 1.70 / (download) - annotate - [select for diffs], Wed Jun 2 09:57:16 2010 UTC (14 years ago) by phessler
Branch: MAIN
Changes since 1.69: +3 -1 lines
Diff to previous 1.69 (colored)

Have dhclient obey the interface's rdomain, instead of doing routes on
rdomain 0.

OK krw@, claudio@
sharp stick prodding from claudio@

Revision 1.69 / (download) - annotate - [select for diffs], Sat Jun 6 04:02:42 2009 UTC (14 years, 11 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.68: +3 -1 lines
Diff to previous 1.68 (colored)

Nuke debug() unless DEBUG is defined. Elminates debug output from
normal operations.

Prodded by deraadt@ a while ago.

Revision 1.68 / (download) - annotate - [select for diffs], Tue Mar 10 23:19:36 2009 UTC (15 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.67: +2 -1 lines
Diff to previous 1.67 (colored)

Add 6-byte MAC address to the log entries for DHCP ACK/NAK/OFFER.
Log the packets before checking the client state. Makes it easy to
find MACs for 'surprise' DHCP servers.

Positive comments from mbalmer@, jasper@.

Revision 1.67 / (download) - annotate - [select for diffs], Mon May 26 03:11:48 2008 UTC (16 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.66: +2 -1 lines
Diff to previous 1.66 (colored)

If an interface has no link at startup, try to force it up, and then
give it about 4 seconds of (silent) grace period before doing the verbose
search for a link...
tested by various developers who got burned a bit

Revision 1.66 / (download) - annotate - [select for diffs], Fri May 9 05:19:14 2008 UTC (16 years ago) by reyk
Branch: MAIN
Changes since 1.65: +2 -1 lines
Diff to previous 1.65 (colored)

- don't give up when the link is not available on startup: dhclient
goes to background and listens on the routing socket for link to come
up before it retries.
- renew the lease whenever the link was lost and becomes active again.
- listen for link state changes on non-ethernet devices like wireless,
the link state becomes active when the wireless has been associated to
the AP and becomes active. this helps to automatically renew the lease
when the user is roaming.

ok beck@, deraadt@

Revision 1.65 / (download) - annotate - [select for diffs], Sun Feb 25 16:27:20 2007 UTC (17 years, 3 months ago) by stevesk
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.64: +1 -4 lines
Diff to previous 1.64 (colored)

remove unused/dangling prototypes and comment reference;
from Mark Lumsden

Revision 1.64 / (download) - annotate - [select for diffs], Sat Jan 27 22:05:24 2007 UTC (17 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.63: +5 -11 lines
Diff to previous 1.63 (colored)

We only poll on the bpf fd and the routing socket fd. No need for
complex list code to keep track. So nuke it.

Also eliminate unnecessary variable ('dead') that means 'rfdesc is
closed'. Just set rfdesc to -1 when it is closed and use that.

As suggested by millert@ and claudio@, don't bother setting revents
members to zero since poll() does that.

Np functional change, just less code.

'looks good' claudio@  'I like where this is going' henning@

Revision 1.63 / (download) - annotate - [select for diffs], Thu Jan 25 01:21:04 2007 UTC (17 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.62: +1 -5 lines
Diff to previous 1.62 (colored)

Cleanup some more code. Eliminate dhcp(), bootp(), parse_options() by
moving the minimal code into do_packet(). Eliminate repeated code for
checking the client hardware address and the reject list by putting
those checks into do_packet as well.

No functional change, just much easier to read.

ok stevesk@

Revision 1.62 / (download) - annotate - [select for diffs], Tue Jan 16 20:22:20 2007 UTC (17 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.61: +8 -14 lines
Diff to previous 1.61 (colored)

More cleanup. Eliminate 'struct packet' by cleverly passing as
parameters just those things actually needed and using existing
structs and information. No functional change.

ok stevesk@

Revision 1.61 / (download) - annotate - [select for diffs], Thu Jan 11 02:36:29 2007 UTC (17 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.60: +1 -3 lines
Diff to previous 1.60 (colored)

Since bootp_packet_handler is always set to do_packet before we
process any packets, eliminate that abstraction and just call
do_packet directly.

No functional change.

ok stevesk

Revision 1.60 / (download) - annotate - [select for diffs], Thu Jan 4 22:30:57 2007 UTC (17 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.59: +2 -3 lines
Diff to previous 1.59 (colored)

Eliminate the 'len' parameter from send_packet() since it always
contains the global value client->packet_length. Use
client->packet_length. No functional change.

Suggested by stevesk@.

Revision 1.59 / (download) - annotate - [select for diffs], Thu Jan 4 22:17:48 2007 UTC (17 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.58: +6 -12 lines
Diff to previous 1.58 (colored)

Another round of cleanup. There is only one instance of struct
dhcp_packet and it is contained in the global *client. So don't pass
around pointers to a struct that contains a pointer to the dhcp_packet
instance. Just use the global client->packet. Eliminate unused struct
packet members and parameter lists accordingly.

No functional change.

Suggestions by stevesk@. ok stevesk@

Revision 1.58 / (download) - annotate - [select for diffs], Thu Jan 4 19:12:41 2007 UTC (17 years, 5 months ago) by stevesk
Branch: MAIN
Changes since 1.57: +1 -2 lines
Diff to previous 1.57 (colored)

<sys/un.h> not needed

Revision 1.57 / (download) - annotate - [select for diffs], Wed Dec 27 20:56:33 2006 UTC (17 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.56: +3 -3 lines
Diff to previous 1.56 (colored)

Since we only have the single global struct interface_info, we
obviously have single global struct client_state and struct
client_config nested inside interface_info and client_state
respectively.

Pull them out to their own global variables and eliminate a bunch
(i.e. hundreds) of multi-level dereferences. Make it much nicer to
read.

No functional change.

"makes sense" henning@

Testing stevesk@, ok stevesk@

Revision 1.56 / (download) - annotate - [select for diffs], Tue Dec 26 21:19:52 2006 UTC (17 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.55: +38 -42 lines
Diff to previous 1.55 (colored)

Our dhclient only handles one interface. Simplify code by using the
single, global, instance of 'struct interface_info' (ifi) rather than
passing around pointers to it.

"I agree" henning@

Testing moritz@ stevesk@, ok stevesk@

Revision 1.55 / (download) - annotate - [select for diffs], Fri Dec 22 03:18:14 2006 UTC (17 years, 5 months ago) by stevesk
Branch: MAIN
Changes since 1.54: +1 -7 lines
Diff to previous 1.54 (colored)

delete prototypes for functions that don't exist

Revision 1.54 / (download) - annotate - [select for diffs], Sat Dec 16 15:13:45 2006 UTC (17 years, 5 months ago) by stevesk
Branch: MAIN
Changes since 1.53: +2 -1 lines
Diff to previous 1.53 (colored)

make /sbin/dhclient-script consistent with other paths; ok henning@

Revision 1.53 / (download) - annotate - [select for diffs], Mon Nov 27 19:32:17 2006 UTC (17 years, 6 months ago) by stevesk
Branch: MAIN
Changes since 1.52: +2 -1 lines
Diff to previous 1.52 (colored)

Recognize when we are sending to a unicast destination IP address and
instead of using BPF, which currently will always set the destination
MAC to broadcast, send using a SOCK_RAW socket and sendmsg() so the
frame has a unicast destination MAC.

Fixes an issue when using a bootp forwarder where unicast DHCPREQUESTs
are dropped at the router/gateway until we reach T2/REBINDING and
change the destination IP to broadcast.

ok henning@ (but doesn't like using a raw socket for this)

Revision 1.52 / (download) - annotate - [select for diffs], Mon Nov 27 16:14:07 2006 UTC (17 years, 6 months ago) by stevesk
Branch: MAIN
Changes since 1.51: +1 -2 lines
Diff to previous 1.51 (colored)

remove invalid comment

Revision 1.51 / (download) - annotate - [select for diffs], Tue Nov 21 15:04:59 2006 UTC (17 years, 6 months ago) by stevesk
Branch: MAIN
Changes since 1.50: +1 -4 lines
Diff to previous 1.50 (colored)

remove unused #defines, no binary change; ok henning@

Revision 1.50 / (download) - annotate - [select for diffs], Tue Nov 21 00:10:06 2006 UTC (17 years, 6 months ago) by stevesk
Branch: MAIN
Changes since 1.49: +1 -3 lines
Diff to previous 1.49 (colored)

re-order includes and eliminate duplicates, no binary change; ok henning@

Revision 1.49 / (download) - annotate - [select for diffs], Tue Aug 29 03:55:09 2006 UTC (17 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.48: +3 -1 lines
Diff to previous 1.48 (colored)

some net if devices do not media negotiate (for link) until brought up.
(for some drivers, this is a bug.  for others, it is part of how they work)
therefore before doing the 10-second link test, we must bring the if up.
ok krw, tested marco ckuethe

Revision 1.48 / (download) - annotate - [select for diffs], Mon May 8 17:25:59 2006 UTC (18 years ago) by deraadt
Branch: MAIN
Changes since 1.47: +2 -1 lines
Diff to previous 1.47 (colored)

add 'link-timeout n' seconds option to grammer, from fkr@hazardous.org
default remains 10 seconds.

Revision 1.47 / (download) - annotate - [select for diffs], Fri Aug 5 16:23:30 2005 UTC (18 years, 10 months ago) by moritz
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.46: +1 -8 lines
Diff to previous 1.46 (colored)

remove duplicate privsep prototypes and put all
of them into privsep.h. ok krw@ henning@

Revision 1.46 / (download) - annotate - [select for diffs], Tue Aug 2 02:34:03 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.45: +7 -15 lines
Diff to previous 1.45 (colored)

Rip out code dealing with multiple/nested interfaces. Each instance of
dhclient is responsible for one interface. Simply skip interface
declarations for other interfaces and store all info in the one
interface structure.

tested by dlg@, ok henning@

Revision 1.45 / (download) - annotate - [select for diffs], Sun Jul 17 19:33:55 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.44: +7 -7 lines
Diff to previous 1.44 (colored)

Insist on correct hardware addresses in dhclient.conf and
dhclient.leases.<if> files. Simplify parse_numeric_aggregate() as
a result, rendering tree.c and tree.h redundant.

ok millert@

Revision 1.44 / (download) - annotate - [select for diffs], Sat Jul 16 18:38:45 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.43: +2 -7 lines
Diff to previous 1.43 (colored)

Rejig struct string_list to use char array rather than char pointer, and
eliminate new_parse_string. alloc.c becomes redundant. Junk a couple of
unused fields (env, envc) in struct client_state.

suggestions by & ok millert@

Revision 1.43 / (download) - annotate - [select for diffs], Sat Jul 16 14:09:51 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.42: +4 -4 lines
Diff to previous 1.42 (colored)

Eliminate unnecessary 'code' field from struct option. Make
dhcp_options const.

ok henning@

Revision 1.42 / (download) - annotate - [select for diffs], Wed Jul 13 23:25:55 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.41: +2 -3 lines
Diff to previous 1.41 (colored)

Repair/rationalize option handling to ensure valid option section is
always sent. Fold store_options into cons_options. Eliminate priority
list of options.

ok deraadt@

Revision 1.41 / (download) - annotate - [select for diffs], Mon Jul 11 18:09:09 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.40: +1 -24 lines
Diff to previous 1.40 (colored)

Expunge unused hashing code and variables.

Revision 1.40 / (download) - annotate - [select for diffs], Sat Jul 9 16:16:11 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.39: +1 -4 lines
Diff to previous 1.39 (colored)

Clean out a few more unused/uninitialized variables.

ok millert@

Revision 1.39 / (download) - annotate - [select for diffs], Sat Jul 9 14:36:15 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.38: +1 -2 lines
Diff to previous 1.38 (colored)

Clean out a few more unused/uninitialized variables.

ok henning@

Revision 1.38 / (download) - annotate - [select for diffs], Sat Jul 9 01:06:00 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.37: +2 -3 lines
Diff to previous 1.37 (colored)

Since we never add more than the default dhcp_universe, expunge the
code to handle mulitple 'vendor' universes. Don't bother with a
specific error message about 'vendor'. An unsupported option is an
unsupported option, and a '.' in an option name is a syntax error.

ok henning@

Revision 1.37 / (download) - annotate - [select for diffs], Fri Jul 8 14:15:23 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.36: +2 -3 lines
Diff to previous 1.36 (colored)

More dead and moribund code removal/cleanup. This time unused parameters
and associated code for store_options().

ok henning@

Revision 1.36 / (download) - annotate - [select for diffs], Fri Jul 8 00:57:36 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.35: +3 -5 lines
Diff to previous 1.35 (colored)

Eliminate unused code and associated parameters.

ok deraadt@

Revision 1.35 / (download) - annotate - [select for diffs], Thu Jul 7 20:03:40 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

Eliminate unused code and associated parameter.

ok deraadt@ millert@.

Revision 1.34 / (download) - annotate - [select for diffs], Thu Jul 7 16:24:24 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

Eliminate tree_cache structure in favour of option_data. Eliminate
redundant level of indirection in building and using option_data
arrays while constructing outgoing packets. Make option_data len field
unsigned.

ok henning@. 'cool!' deraadt@.

Revision 1.33 / (download) - annotate - [select for diffs], Thu May 6 22:29:15 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.32: +1 -3 lines
Diff to previous 1.32 (colored)

remove more unused code

Revision 1.32 / (download) - annotate - [select for diffs], Tue May 4 22:23:01 2004 UTC (20 years, 1 month ago) by mickey
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

do not overload libc function names causing linker troubles

Revision 1.31 / (download) - annotate - [select for diffs], Tue May 4 20:28:40 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.30: +1 -10 lines
Diff to previous 1.30 (colored)

remove things not used, spotted by lint mostly; ok henning

Revision 1.30 / (download) - annotate - [select for diffs], Tue May 4 18:58:50 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.29: +15 -18 lines
Diff to previous 1.29 (colored)

more shrink and lint fixes; henning ok

Revision 1.29 / (download) - annotate - [select for diffs], Tue May 4 12:52:05 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.28: +12 -1 lines
Diff to previous 1.28 (colored)

privilege seperate dhclient.
the privileged child's duty is the dhclient-script env setup & exection.
the parent process now chroots to /var/empty and drops privileges to _dhcp
mostly hacked at vancouver airport
with some feedback from krw@ and otto@, tested to not break installs by krw@

Revision 1.28 / (download) - annotate - [select for diffs], Wed Apr 14 20:22:27 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.27: +1 -3 lines
Diff to previous 1.27 (colored)

get rif of the few dmalloc/dfree occurances that were left

Revision 1.27 / (download) - annotate - [select for diffs], Wed Apr 14 20:15:47 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.26: +7 -13 lines
Diff to previous 1.26 (colored)

turns out more is obsolete now
inspired by diff from Emil Mikulic <emikulic@dmr.ath.cx>

Revision 1.26 / (download) - annotate - [select for diffs], Fri Mar 5 23:57:16 2004 UTC (20 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.25: +1 -2 lines
Diff to previous 1.25 (colored)

remove even more goo

Revision 1.25 / (download) - annotate - [select for diffs], Tue Mar 2 18:49:21 2004 UTC (20 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.24: +1 -3 lines
Diff to previous 1.24 (colored)

more pruning; henning ok

Revision 1.24 / (download) - annotate - [select for diffs], Tue Mar 2 15:41:44 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.23: +1 -4 lines
Diff to previous 1.23 (colored)

zap interface flags

Revision 1.23 / (download) - annotate - [select for diffs], Tue Mar 2 13:39:44 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.22: +1 -4 lines
Diff to previous 1.22 (colored)

we deal with one interface at a time, so remove the interface list gunk.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Mar 2 12:56:30 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.21: +2 -3 lines
Diff to previous 1.21 (colored)

remove dummy_interfaces and fallback_interface gunk

Revision 1.21 / (download) - annotate - [select for diffs], Tue Mar 2 12:46:44 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.20: +1 -2 lines
Diff to previous 1.20 (colored)

our interface discovery is so quiet now (nonexistant) that we don't need a
quiet_interface_discovery flag any more

Revision 1.20 / (download) - annotate - [select for diffs], Tue Mar 2 12:40:31 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

since we're dealing with one interface and not quite a few ones we can give
this one onterface as parameter to discove_interfaces and get rid of quite
some of the multiple-interface-discover logic

Revision 1.19 / (download) - annotate - [select for diffs], Wed Feb 25 14:22:12 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.18: +1 -3 lines
Diff to previous 1.18 (colored)

doesn't quite make sense to have a wrapper to a wrapper to the incredible
amount of ~ 20 lines of code in their own file...
and another one bites the dust

Revision 1.18 / (download) - annotate - [select for diffs], Tue Feb 24 17:26:43 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.17: +2 -7 lines
Diff to previous 1.17 (colored)

whack unused token ring code and a few empty functions

Revision 1.17 / (download) - annotate - [select for diffs], Tue Feb 24 17:02:40 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.16: +27 -20 lines
Diff to previous 1.16 (colored)

zap more unused crap

Revision 1.16 / (download) - annotate - [select for diffs], Tue Feb 24 15:35:56 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.15: +93 -336 lines
Diff to previous 1.15 (colored)

get rid of tons of structs we never use, a lot of new_someotherjunk functions
in alloc.c we never call, and a shitload of genius comments like
char *script_name; /* name of script */
char *server_name; /* name of server */
etc etc etc...

Revision 1.15 / (download) - annotate - [select for diffs], Tue Feb 24 14:49:08 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.14: +2 -10 lines
Diff to previous 1.14 (colored)

discover_interfaces doesn't run in multiple modes any more - kill unreachable
code, partitally server-only

Revision 1.14 / (download) - annotate - [select for diffs], Tue Feb 24 13:36:13 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.13: +4 -2 lines
Diff to previous 1.13 (colored)

remove dynamic port gunk

Revision 1.13 / (download) - annotate - [select for diffs], Tue Feb 24 13:21:32 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.12: +1 -2 lines
Diff to previous 1.12 (colored)

cut unreachable code

Revision 1.12 / (download) - annotate - [select for diffs], Tue Feb 24 13:08:26 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.11: +25 -8 lines
Diff to previous 1.11 (colored)

cut more crap - no binary change

Revision 1.11 / (download) - annotate - [select for diffs], Tue Feb 24 12:41:28 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.10: +1 -7 lines
Diff to previous 1.10 (colored)

kill pidfile gunk

Revision 1.10 / (download) - annotate - [select for diffs], Mon Feb 23 20:16:00 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

goodbye VOIDPTR

Revision 1.9 / (download) - annotate - [select for diffs], Mon Feb 23 20:09:02 2004 UTC (20 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.8: +23 -23 lines
Diff to previous 1.8 (colored)

remove time_t related crud; henning ok

Revision 1.8 / (download) - annotate - [select for diffs], Mon Feb 23 19:51:15 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.7: +13 -123 lines
Diff to previous 1.7 (colored)

remove prototypes we don't implement

Revision 1.7 / (download) - annotate - [select for diffs], Mon Feb 23 19:19:12 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.6: +1 -32 lines
Diff to previous 1.6 (colored)

remove allocation/storage/search code for subnets, shared networks, and
leases - it is server-only code.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Feb 23 18:21:15 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.5: +1 -57 lines
Diff to previous 1.5 (colored)

dhclient always uses bpf on openbsd no matter what, it works, and we don't
need to fallback to their raw socket code
suddenly dhclient is so fast...
pb tested and sez ok

Revision 1.5 / (download) - annotate - [select for diffs], Tue Feb 10 13:12:48 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored)

at startup, before sending several DHCPDISCOVER and waiting ages for answers,
check the link state of the interface(s) in question and don't try on
intrfaces that for sure have no link. interfaces with unknown linkstates are
treated as if they had a link, not all drivers are capable of reporting
linkstate upstream, and for some media there is no such thing as a link state.
saves quite sme time when booting notebooks configured for dhcp without
teh cable inserted...
note that this is the not yet active copy of dhclient
ok grange@ mcbride@ pb@ naddy@

Revision 1.4 / (download) - annotate - [select for diffs], Sat Feb 7 13:26:35 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.3: +370 -397 lines
Diff to previous 1.3 (colored)

more KNF From: Emil Mikulic <emikulic@dmr.ath.cx>
great job.
no binary change.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Feb 4 12:16:56 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

$OpenBSD$, tedu

Revision 1.2 / (download) - annotate - [select for diffs], Wed Feb 4 01:18:26 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.1: +330 -462 lines
Diff to previous 1.1 (colored)

8579 lines of KNF, ANSO and zap-junk diff without the resulting binary
changing by a single byte.
partly from theo

Revision 1.1 / (download) - annotate - [select for diffs], Sun Jan 18 01:26:20 2004 UTC (20 years, 4 months ago) by deraadt
Branch: MAIN

this is where dhclient will start surgery

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.