OpenBSD CVS

CVS log for src/sbin/dhclient/clparse.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.203 / (download) - annotate - [select for diffs], Sat Feb 27 17:44:58 2021 UTC (3 years, 3 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.202: +3 -1 lines
Diff to previous 1.202 (colored)

Stop checking 'epoch' in get_recorded_lease() and just set it as
required in read_lease_db(). It's already set in packet_to_lease() and
thus both paths to TAILQ_INSERT(lease_db) ensure there is a non-zero
epoch in all lease_db entries.

Revision 1.202 / (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.201: +10 -9 lines
Diff to previous 1.201 (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.201 / (download) - annotate - [select for diffs], Thu Dec 10 18:35:31 2020 UTC (3 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.200: +16 -43 lines
Diff to previous 1.200 (colored)

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

Revision 1.200 / (download) - annotate - [select for diffs], Sun Dec 6 19:51:03 2020 UTC (3 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.199: +6 -4 lines
Diff to previous 1.199 (colored)

Oops. Missed chunk in previous.

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

Original diff, tweaks & ok kn@

Revision 1.199 / (download) - annotate - [select for diffs], Wed May 13 20:55:41 2020 UTC (4 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.198: +11 -10 lines
Diff to previous 1.198 (colored)

Repair 'domain-search' parsing broken in r1.191.

Revision 1.198 / (download) - annotate - [select for diffs], Wed May 13 20:28:10 2020 UTC (4 years ago) by krw
Branch: MAIN
Changes since 1.197: +3 -3 lines
Diff to previous 1.197 (colored)

We don't count a terminating NUL in the length of option data.

Revision 1.197 / (download) - annotate - [select for diffs], Wed May 13 20:14:39 2020 UTC (4 years ago) by krw
Branch: MAIN
Changes since 1.196: +3 -4 lines
Diff to previous 1.196 (colored)

Nuke a variable that is always set to 0.

Revision 1.196 / (download) - annotate - [select for diffs], Wed May 13 19:48:10 2020 UTC (4 years ago) by krw
Branch: MAIN
Changes since 1.195: +2 -3 lines
Diff to previous 1.195 (colored)

No need to memcpy() into a string created by strdup().

Revision 1.195 / (download) - annotate - [select for diffs], Sun Feb 2 20:33:52 2020 UTC (4 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.194: +9 -3 lines
Diff to previous 1.194 (colored)

Tweak dhclient(8) timing defaults depending on SMALL rather than using
/dev/stdin to fake a dhclient.conf file during install. Simplifies and
shortens install.sub code. Allows further restrictions to be applied
to '-c' specified files.

Revision 1.194 / (download) - annotate - [select for diffs], Tue Dec 17 14:21:54 2019 UTC (4 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.193: +4 -1 lines
Diff to previous 1.193 (colored)

Reject leases that do not provide a subnet mask for the address being
provided. Restores behaviour previously provided by the default
dhclient.conf.

Revision 1.193 / (download) - annotate - [select for diffs], Tue Jul 23 14:09:47 2019 UTC (4 years, 10 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.192: +7 -4 lines
Diff to previous 1.192 (colored)

Compilers may not be as magical as I hope, so revert to using memcpy()
when treating various sized integers as arrays of bytes.

Doubts expressed by kettenis@ on behalf of strict alignment
architectures.

Revision 1.192 / (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.191: +28 -25 lines
Diff to previous 1.191 (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.191 / (download) - annotate - [select for diffs], Mon Jul 22 15:59:49 2019 UTC (4 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.190: +7 -8 lines
Diff to previous 1.190 (colored)

Eliminate pointless "... else {}" branch to improve readability.

Revision 1.190 / (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.189: +13 -11 lines
Diff to previous 1.189 (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.189 / (download) - annotate - [select for diffs], Sat Jul 20 17:14:15 2019 UTC (4 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.188: +94 -109 lines
Diff to previous 1.188 (colored)

Use same 'switch (token) ...' idiom in parse_lease_decl() and
parse_conf_decl(). Smaller, less confusing.

No intentional functional change.

Revision 1.188 / (download) - annotate - [select for diffs], Sat Jul 20 15:39:55 2019 UTC (4 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.187: +24 -27 lines
Diff to previous 1.187 (colored)

Sort TOK_USELEASE case into proper alphabetic location in
switch statement. Nuke TOK_LEASE handling (neutered since
2017) in config file.

Revision 1.187 / (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.186: +8 -9 lines
Diff to previous 1.186 (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.186 / (download) - annotate - [select for diffs], Sat Jun 29 16:39:57 2019 UTC (4 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.185: +6 -6 lines
Diff to previous 1.185 (colored)

write_lease_db() only needs ifi->name and ifi->lease_db.

read_lease_db() can use a better param name (lease_db instead
of tq).

Makes the two more obviously related. No intentional functional
change.

Revision 1.185 / (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.184: +67 -1 lines
Diff to previous 1.184 (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.184 / (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.183: +10 -4 lines
Diff to previous 1.183 (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.183 / (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.182: +1 -40 lines
Diff to previous 1.182 (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.182 / (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.181: +5 -5 lines
Diff to previous 1.181 (colored)

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

Revision 1.181 / (download) - annotate - [select for diffs], Sat Jan 26 22:55:10 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.180: +24 -1 lines
Diff to previous 1.180 (colored)

Add 'uselease' statement to allow the disabling of built-in or
previously specified 'append', 'default', 'ignore', 'prepend', or
'supersede' actions on the values provided in leases.

Revision 1.180 / (download) - annotate - [select for diffs], Fri Jan 18 02:16:31 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.179: +2 -2 lines
Diff to previous 1.179 (colored)

Oops. Nuke debug statement that snuck it.

Revision 1.179 / (download) - annotate - [select for diffs], Fri Jan 18 02:12:36 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.178: +28 -29 lines
Diff to previous 1.178 (colored)

Shuffle lease file reading code to improve clarity and shorten some
lines. No intentional functional change.

Revision 1.178 / (download) - annotate - [select for diffs], Fri Jan 18 01:46:11 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.177: +3 -3 lines
Diff to previous 1.177 (colored)

Yet another long line broke cover.

Revision 1.177 / (download) - annotate - [select for diffs], Fri Jan 18 01:38:58 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.176: +2 -2 lines
Diff to previous 1.176 (colored)

Be consistent in explicitly testing memcmp() return values.

Revision 1.176 / (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.175: +12 -2 lines
Diff to previous 1.175 (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.175 / (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.174: +22 -11 lines
Diff to previous 1.174 (colored)

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

Revision 1.174 / (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.173: +3 -3 lines
Diff to previous 1.173 (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.173 / (download) - annotate - [select for diffs], Mon Jan 14 02:51:29 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.172: +4 -1 lines
Diff to previous 1.172 (colored)

Check NULLness of ignore list inside apply_ignore_list() and not
before calling it.

Revision 1.172 / (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.171: +40 -1 lines
Diff to previous 1.171 (colored)

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

Revision 1.171 / (download) - annotate - [select for diffs], Sun Jan 13 21:55:32 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.170: +3 -2 lines
Diff to previous 1.170 (colored)

White space nits.

Revision 1.170 / (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.169: +101 -1 lines
Diff to previous 1.169 (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.169 / (download) - annotate - [select for diffs], Sun Nov 4 16:32:11 2018 UTC (5 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.168: +3 -3 lines
Diff to previous 1.168 (colored)

No names in function prototypes. Spaces after commas in
function prototypes.

Revision 1.168 / (download) - annotate - [select for diffs], Sat Feb 10 23:25:15 2018 UTC (6 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.167: +15 -5 lines
Diff to previous 1.167 (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.167 / (download) - annotate - [select for diffs], Tue Feb 6 00:25:09 2018 UTC (6 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.166: +2 -2 lines
Diff to previous 1.166 (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.166 / (download) - annotate - [select for diffs], Fri Jan 5 15:03:09 2018 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.165: +69 -66 lines
Diff to previous 1.165 (colored)

Complete and fix grammar in comments and bring grammar terms,
function names and function code into sync.

Revision 1.165 / (download) - annotate - [select for diffs], Thu Jan 4 19:52:30 2018 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.164: +9 -11 lines
Diff to previous 1.164 (colored)

Compact some whitespace, unsplit now shorter lines.

Revision 1.164 / (download) - annotate - [select for diffs], Thu Jan 4 18:26:04 2018 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.163: +11 -12 lines
Diff to previous 1.163 (colored)

Comments and grammar use '_decl' so use _decl instead of _declaration
in the names of the respective parsing functions.

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

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

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

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

Revision 1.161 / (download) - annotate - [select for diffs], Tue Jan 2 00:13:27 2018 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.160: +61 -49 lines
Diff to previous 1.160 (colored)

More grammar comments improvements.

Revision 1.160 / (download) - annotate - [select for diffs], Mon Jan 1 15:07:58 2018 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.159: +51 -45 lines
Diff to previous 1.159 (colored)

Tweak syntax comments into consistency and completeness.

Revision 1.159 / (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.158: +5 -13 lines
Diff to previous 1.158 (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.158 / (download) - annotate - [select for diffs], Sun Dec 17 14:24:04 2017 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.157: +45 -53 lines
Diff to previous 1.157 (colored)

Further simplifY lease parsing. Fold add_lease() into read_lease_db(),
and move all lease parsing into parse_lease().

Revision 1.157 / (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.156: +31 -31 lines
Diff to previous 1.156 (colored)

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

Revision 1.156 / (download) - annotate - [select for diffs], Wed Dec 13 18:53:04 2017 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.155: +2 -2 lines
Diff to previous 1.155 (colored)

Fix whitespace botch that snuck in.

Revision 1.155 / (download) - annotate - [select for diffs], Wed Dec 13 18:45:08 2017 UTC (6 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.154: +7 -13 lines
Diff to previous 1.154 (colored)

Simplifiy parser by not worrying about nesting 'interface <if> {}'
statements. They are silly but harmless and work fine.

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

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

Revision 1.153 / (download) - annotate - [select for diffs], Fri Dec 8 20:17:28 2017 UTC (6 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.152: +23 -3 lines
Diff to previous 1.152 (colored)

When accepting a BOOTP lease, do not leak offered values of lease
time, renewal time, rebinding time. Use the ACTION_DEFAULT mechanism
to set the default expiry time for any lease so gauche as to not
provide one. Use the DHCP default lease times for BOOTP leases instead
of, bizarrely, shorter times.

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

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

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

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

Revision 1.150 / (download) - annotate - [select for diffs], Thu Nov 9 12:34:25 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.149: +8 -10 lines
Diff to previous 1.149 (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.149 / (download) - annotate - [select for diffs], Mon Nov 6 13:27:19 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.148: +7 -1 lines
Diff to previous 1.148 (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.148 / (download) - annotate - [select for diffs], Mon Oct 23 13:31:35 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.147: +9 -9 lines
Diff to previous 1.147 (colored)

Use 'for (;;)' instead of a mix of "while (1) {}" and
"do {} while (1)".

Revision 1.147 / (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.146: +27 -19 lines
Diff to previous 1.146 (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.146 / (download) - annotate - [select for diffs], Sat Oct 21 14:40:13 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.145: +15 -11 lines
Diff to previous 1.145 (colored)

Last but not least, bring parse_interface_declaration()
into the 0/1 for success world.

Revision 1.145 / (download) - annotate - [select for diffs], Sat Oct 21 13:31:22 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.144: +2 -2 lines
Diff to previous 1.144 (colored)

Whitespace.

Revision 1.144 / (download) - annotate - [select for diffs], Sat Oct 21 13:27:15 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.143: +25 -17 lines
Diff to previous 1.143 (colored)

Bring parse_client_lease_statement() into the new world by
return 0/1 for success.

Revision 1.143 / (download) - annotate - [select for diffs], Mon Oct 16 12:39:33 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.142: +109 -102 lines
Diff to previous 1.142 (colored)

Sort & update syntax comments to match code. Sort
TOK_* case:'s alphabetically to make it easier to
find things.

Revision 1.142 / (download) - annotate - [select for diffs], Mon Oct 16 12:27:12 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.141: +17 -19 lines
Diff to previous 1.141 (colored)

Bring parse_reject_statement() into line by
returning 0/1 for success, etc. Simplify it
by only supporting a single ip address per
statement, as dhclient.conf(5) states. Don't
add duplicate addresses to the reject list.

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

Whitespace fix.

Revision 1.140 / (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.139: +67 -77 lines
Diff to previous 1.139 (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.139 / (download) - annotate - [select for diffs], Sat Oct 14 01:15:36 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.138: +37 -54 lines
Diff to previous 1.138 (colored)

Tweak parse_option_list() to return 0/1 to indicate success,
to not touch existing data on error paths, to handle ';'
better, emit single error message ("expecting comma
delimited list of option names.").

Revision 1.138 / (download) - annotate - [select for diffs], Fri Oct 13 13:53:28 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.137: +58 -55 lines
Diff to previous 1.137 (colored)

Tweak parse_option_decl() to return 0/1 to indicate success,
to not touch existing data on error paths, to handle ';'
better.

Revision 1.137 / (download) - annotate - [select for diffs], Thu Oct 12 14:55:49 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.136: +3 -2 lines
Diff to previous 1.136 (colored)

Don't leak string that overflows the option data buffer.

Revision 1.136 / (download) - annotate - [select for diffs], Thu Oct 12 13:28:49 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.135: +5 -3 lines
Diff to previous 1.135 (colored)

Stop leaks of SSID strings. Whitespace fix.

Revision 1.135 / (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.134: +37 -30 lines
Diff to previous 1.134 (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.134 / (download) - annotate - [select for diffs], Wed Oct 11 18:29:30 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.133: +7 -11 lines
Diff to previous 1.133 (colored)

Eliminate unneeded intermediate variable. Fix
some 'return;'s that should be 'break;'s.

Revision 1.133 / (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.132: +11 -4 lines
Diff to previous 1.132 (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.132 / (download) - annotate - [select for diffs], Wed Oct 11 10:14:15 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.131: +5 -21 lines
Diff to previous 1.131 (colored)

Tweak parse_decimal() and its invocations to emit a
single error message ("expecting integer between x and y")
and to properly handle ';' in error cases.

Revision 1.131 / (download) - annotate - [select for diffs], Tue Oct 10 14:01:08 2017 UTC (6 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.130: +2 -5 lines
Diff to previous 1.130 (colored)

Tweak parse_boolean() to be more like its friends.
i.e. handle ';' better, and issue error
message ("expecting boolean.") itself.

Revision 1.130 / (download) - annotate - [select for diffs], Mon Oct 9 21:33:11 2017 UTC (6 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.129: +17 -10 lines
Diff to previous 1.129 (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.129 / (download) - annotate - [select for diffs], Wed Sep 20 19:21:00 2017 UTC (6 years, 8 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.128: +2 -3 lines
Diff to previous 1.128 (colored)

Tweak, shorten, use more consistant verbiage.

Revision 1.128 / (download) - annotate - [select for diffs], Wed Sep 20 16:09:42 2017 UTC (6 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.127: +3 -3 lines
Diff to previous 1.127 (colored)

Wrong captilization, long lines.

Revision 1.127 / (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.126: +5 -4 lines
Diff to previous 1.126 (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.126 / (download) - annotate - [select for diffs], Thu Sep 14 00:10:17 2017 UTC (6 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.125: +4 -4 lines
Diff to previous 1.125 (colored)

Strive to rationalize fatal[x]() usage and
verbiage.

Revision 1.125 / (download) - annotate - [select for diffs], Mon Aug 14 22:12:59 2017 UTC (6 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.124: +3 -3 lines
Diff to previous 1.124 (colored)

Try for consistency in sizeof() usage.

No intentional functional change.

Revision 1.124 / (download) - annotate - [select for diffs], Fri Jul 14 16:21:03 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.123: +18 -18 lines
Diff to previous 1.123 (colored)

Replace remaining "!var" expressions with
"<var> == 0", "!(<var> & FLAG)" with
"(<var> & FLAG) == 0", "!<func()>"
with "<func()> == 0" and "!<define>" with
"<define> == 0". And the positive cases
as well.

A few stray == NULL and != NULL as well.

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

Replace remaining "!<pointer>" expressions with
"<pointer> == NULL". And of course "<pointer>"
expressions with "<pointer> != NULL".

Revision 1.122 / (download) - annotate - [select for diffs], Mon Jul 10 00:47:47 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.121: +7 -7 lines
Diff to previous 1.121 (colored)

Use a modern spacious idiom on all function local variable
declarations.

Revision 1.121 / (download) - annotate - [select for diffs], Sun Jul 9 21:29:19 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.120: +26 -26 lines
Diff to previous 1.120 (colored)

Be consistent. "return (e);" -> "return e;"

Revision 1.120 / (download) - annotate - [select for diffs], Sun Jul 9 18:45:27 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.119: +26 -36 lines
Diff to previous 1.119 (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.119 / (download) - annotate - [select for diffs], Sat Jul 8 20:38:31 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.118: +5 -11 lines
Diff to previous 1.118 (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.118 / (download) - annotate - [select for diffs], Sat Jul 8 15:26:27 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.117: +2 -2 lines
Diff to previous 1.117 (colored)

Always use strcasecmp() when comparing user input to option
names, not just 2 out of 3.

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

Always use uintNN_t instead of sometimes u_intNN_t
and sometimes uintNN_t.

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

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

Revision 1.115 / (download) - annotate - [select for diffs], Wed Jul 5 16:17:41 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.114: +73 -71 lines
Diff to previous 1.114 (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.114 / (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.113: +1 -15 lines
Diff to previous 1.113 (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.113 / (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.112: +2 -2 lines
Diff to previous 1.112 (colored)

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

Revision 1.112 / (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.111: +5 -6 lines
Diff to previous 1.111 (colored)

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

Nuke empty struct client_state.

No intentional functional change.

Revision 1.111 / (download) - annotate - [select for diffs], Sat Jun 10 18:03:50 2017 UTC (7 years ago) by krw
Branch: MAIN
Changes since 1.110: +1 -2 lines
Diff to previous 1.110 (colored)

Nuke unused field bootp_policy and associated enum{}.

Revision 1.110 / (download) - annotate - [select for diffs], Sat Apr 8 20:16:04 2017 UTC (7 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.109: +11 -8 lines
Diff to previous 1.109 (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.109 / (download) - annotate - [select for diffs], Tue Apr 4 13:01:20 2017 UTC (7 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.108: +5 -2 lines
Diff to previous 1.108 (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.108 / (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.107: +12 -11 lines
Diff to previous 1.107 (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.107 / (download) - annotate - [select for diffs], Mon Apr 3 15:34:46 2017 UTC (7 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.106: +9 -10 lines
Diff to previous 1.106 (colored)

Tweak parse_string() to not consume the ';'. Simplifies/shortens
some logic.

Revision 1.106 / (download) - annotate - [select for diffs], Mon Apr 3 14:16:34 2017 UTC (7 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.105: +9 -9 lines
Diff to previous 1.105 (colored)

Tweak 'expecting' parse_warn() messages to be more consistent.

Revision 1.105 / (download) - annotate - [select for diffs], Sun Feb 12 13:55:01 2017 UTC (7 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.104: +5 -4 lines
Diff to previous 1.104 (colored)

Adjust lines that are too long.

Revision 1.104 / (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.103: +7 -6 lines
Diff to previous 1.103 (colored)

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

No objections heard. Feedback from millert@ guenther@

Revision 1.103 / (download) - annotate - [select for diffs], Thu Oct 6 16:29:17 2016 UTC (7 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.102: +19 -23 lines
Diff to previous 1.102 (colored)

Add support for RFC 6842, which says the client MUST drop packets when
the server provides a client-identifier value and it doesn't match
the value the client sent.

So stop suppressing client-identifer info in the leases file and when
reading the leases file stop discarding leases that don't have current
client-identifier info. Don't use them, but keep them around in case
the client-identifier info changes back next time.

Also construct the default client-identifier (if needed) before reading
the leases file.

Revision 1.102 / (download) - annotate - [select for diffs], Fri Sep 30 13:20:57 2016 UTC (7 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (colored)

Zap stray whitespace.

Revision 1.101 / (download) - annotate - [select for diffs], Thu Sep 1 13:27:04 2016 UTC (7 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.100: +5 -5 lines
Diff to previous 1.100 (colored)

Cut back the default values for the various timeout/interval values. We no
longer live in a 10Mb/sec shared media world with 1Mhz Vaxen DHCP servers.

ok benno@ otto@ phessler@

Revision 1.100 / (download) - annotate - [select for diffs], Thu Sep 1 10:29:16 2016 UTC (7 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.99: +9 -8 lines
Diff to previous 1.99 (colored)

Informative comments describing the various timing fields (initial_interval,
reboot_timeout, etc.) when setting them to their defaults.

Revision 1.99 / (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.98: +2 -1 lines
Diff to previous 1.98 (colored)

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

ok krw@

Revision 1.98 / (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.97: +19 -17 lines
Diff to previous 1.97 (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.97 / (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.96: +12 -4 lines
Diff to previous 1.96 (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.96 / (download) - annotate - [select for diffs], Sun Jul 31 18:55:16 2016 UTC (7 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.95: +5 -1 lines
Diff to previous 1.95 (colored)

Ask for DHO_BOOTFILE_NAME and DHO_TFTP_SERVER by default. May prove
useful to autoinstall in the future and in the meantime can provide
information on what the dhcp server has done with the desired server
name and file name info.

Original diff from Patrik Lundin via tech@

Revision 1.95 / (download) - annotate - [select for diffs], Fri Jun 3 02:31:17 2016 UTC (8 years ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.94: +2 -2 lines
Diff to previous 1.94 (colored)

The networks I use are sufficiently fast that a 10 second "reboot" timeout
is not necessary, and in fact quite annoying when I swtich networks and
want to get back to the init state quickly. Default instead to 1 second.
The very few users who encounter problems may edit dhclient.conf.
ok benno
krw does not object

Revision 1.94 / (download) - annotate - [select for diffs], Sat Feb 6 19:30:52 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.93: +17 -1 lines
Diff to previous 1.93 (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.93 / (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.92: +3 -1 lines
Diff to previous 1.92 (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.92 / (download) - annotate - [select for diffs], Mon May 18 17:51:21 2015 UTC (9 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.91: +2 -2 lines
Diff to previous 1.91 (colored)

Tweak parsing so that hostnames starting with 0-9 are accepted.

Reported long ago by matthieu@. Also Jacob Berkman via the lists.

Tests and suggestions from Jacob and Matthieu.

Revision 1.91 / (download) - annotate - [select for diffs], Sun Feb 1 18:43:39 2015 UTC (9 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.90: +3 -5 lines
Diff to previous 1.90 (colored)

free(NULL) works, so stop checking for non-zero length allocation
or non-NULLness before calling free().

This batch from Benjamin Baier.

Revision 1.90 / (download) - annotate - [select for diffs], Mon Nov 3 22:06:39 2014 UTC (9 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.89: +9 -3 lines
Diff to previous 1.89 (colored)

Don't leak static leases when the 'lease {}' parsing fails or one static
lease supersedes an earlier one.

Revision 1.89 / (download) - annotate - [select for diffs], Sun Nov 2 15:18:32 2014 UTC (9 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.88: +2 -2 lines
Diff to previous 1.88 (colored)

Pesky whitespace and spurious parenthesis.

Revision 1.88 / (download) - annotate - [select for diffs], Mon Oct 27 13:36:21 2014 UTC (9 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.87: +2 -2 lines
Diff to previous 1.87 (colored)

Zap extraneous whitespace and a stuttered extra 'break;'.

Revision 1.87 / (download) - annotate - [select for diffs], Mon May 12 13:12:41 2014 UTC (10 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.86: +3 -2 lines
Diff to previous 1.86 (colored)

Since all static leases are in one file, /etc/dhclient.conf, there is no
'wrong interface' specification. So display that error message only for
non-static leases. i.e. when reading /var/db/dhclient.leases.<if>.

Revision 1.86 / (download) - annotate - [select for diffs], Sun May 11 12:40:37 2014 UTC (10 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.85: +9 -43 lines
Diff to previous 1.85 (colored)

Rework/restore recorded lease handling. Actually use 'lease'
statements in dhclient.conf.

Recorded and static leases should now be bound to interfaces when
appropriate.

.... Ken

Revision 1.85 / (download) - annotate - [select for diffs], Mon May 5 18:02:49 2014 UTC (10 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.84: +2 -2 lines
Diff to previous 1.84 (colored)

Zap trailing whitespace. Started by pointed comments from andre@.

Revision 1.84 / (download) - annotate - [select for diffs], Mon May 5 14:44:18 2014 UTC (10 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.83: +3 -4 lines
Diff to previous 1.83 (colored)

A couple of malloc()+memset(0) -> calloc.

Revision 1.83 / (download) - annotate - [select for diffs], Sat Jan 25 05:21:23 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.82: +5 -3 lines
Diff to previous 1.82 (colored)

Correct parsing of dhclient.conf statements 'fixed-address' and
'next-server'. Modify new lease being cloned with their values
rather than overwriting original lease being cloned.

Revision 1.82 / (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.81: +20 -1 lines
Diff to previous 1.81 (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.81 / (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.80: +8 -1 lines
Diff to previous 1.80 (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.80 / (download) - annotate - [select for diffs], Mon Jan 20 01:12:17 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.79: +2 -4 lines
Diff to previous 1.79 (colored)

Don't silently skip the next statement when encountering an
invalid IP in a reject statement.

Revision 1.79 / (download) - annotate - [select for diffs], Mon Jan 20 00:36:52 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

Cast pointer to (u_int8_t *) when assigning it to a u_int8_t *
variable.

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

We don't have any (and I can't find elsewhere) signed 16 bit or
signed 8 bit dhcp option types. So nuke getShort() and all 's' and
'b' format support. While here use '%u'/'%lu' and not
'%d'/'%ld' to snprintf() unsigned values.

Revision 1.77 / (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.76: +64 -37 lines
Diff to previous 1.76 (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.76 / (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.75: +2 -2 lines
Diff to previous 1.75 (colored)

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

Revision 1.75 / (download) - annotate - [select for diffs], Sat Jan 18 01:19:01 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.74: +1 -2 lines
Diff to previous 1.74 (colored)

Remove superfluous assignment to local variable 'val' just before
exiting.

Revision 1.74 / (download) - annotate - [select for diffs], Sat Jan 18 01:03:56 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.73: +3 -3 lines
Diff to previous 1.73 (colored)

Make parse_warn() messages consistantly use 'expecting' rather
than occasionally 'expected'. End all with a '.'.

Revision 1.73 / (download) - annotate - [select for diffs], Sat Jan 18 00:51:55 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.72: +28 -14 lines
Diff to previous 1.72 (colored)

Never silently consume the following statement when unexpectedly
encountering a ';'. I.e. when checking the token type, 'skip_to_semi()'
after 'parse_warn()' only when the parsed token wasn't a ';'.

Revision 1.72 / (download) - annotate - [select for diffs], Fri Jan 17 22:48:10 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.71: +7 -5 lines
Diff to previous 1.71 (colored)

Make parse_X return -1 when it encounters a parsing error. Enables
recognition of zero length value vs parsing error. This lets us avoid
the erroneous consumption of the semicolon ending the 'X' value, and
the resulting accidental consumption of the following line in the file
being parsed.

Revision 1.71 / (download) - annotate - [select for diffs], Mon Jan 13 23:42:18 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.70: +17 -22 lines
Diff to previous 1.70 (colored)

peek_token() a bit more to replace a bunch of manual checks with
the perfectly adequate parse_semi(). And some blocks didn't even
need to peek.

Revision 1.70 / (download) - annotate - [select for diffs], Mon Jan 13 21:36:46 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.69: +4 -4 lines
Diff to previous 1.69 (colored)

Don't eat another token looking for a ';' after skip_to_semi() has
been invoked. Fixes silent loss of the statement following a broken or
inapplicable 'interface' declaration in a lease, or an unrecognized
lease attribute.

Revision 1.69 / (download) - annotate - [select for diffs], Mon Jan 13 21:04:19 2014 UTC (10 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.68: +1 -3 lines
Diff to previous 1.68 (colored)

No need to 'clear the peek buffer' when closing a file. The next
file opener will call new_parse() to initialize that amoung
other things. Nuke extraneous blank line in passing.

Revision 1.68 / (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.67: +2 -4 lines
Diff to previous 1.67 (colored)

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

Revision 1.67 / (download) - annotate - [select for diffs], Fri Jan 10 01:25:03 2014 UTC (10 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.66: +3 -4 lines
Diff to previous 1.66 (colored)

skip_to_semi() is gilding the lily when the next statement breaks out
of the loop and closes the file being parsed. And the previous
statement warns the user the leases file being parsed has been
determined to be corrupt. Eliminate further gilding in the form of an
'else' after the same 'if' clause includes the 'break'.

Revision 1.66 / (download) - annotate - [select for diffs], Fri Jan 10 01:07:58 2014 UTC (10 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.65: +3 -2 lines
Diff to previous 1.65 (colored)

KNF (UNF?). Split annoying long line.

Revision 1.65 / (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.64: +8 -9 lines
Diff to previous 1.64 (colored)

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

Revision 1.64 / (download) - annotate - [select for diffs], Sat Dec 28 21:48:04 2013 UTC (10 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

Remove unused variable 'token'. Spotted by deraadt@

Revision 1.63 / (download) - annotate - [select for diffs], Sun Dec 22 02:37:25 2013 UTC (10 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.62: +23 -29 lines
Diff to previous 1.62 (colored)

Don't look for two semi-colons when encountering an unrecognized
statement in dhclient.conf.

Revision 1.62 / (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.61: +10 -1 lines
Diff to previous 1.61 (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.61 / (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.60: +5 -1 lines
Diff to previous 1.60 (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.60 / (download) - annotate - [select for diffs], Sun Jun 9 16:21:50 2013 UTC (11 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.59: +4 -1 lines
Diff to previous 1.59 (colored)

Re-apply static route and classless static route support -- this time
passing the correct destination for the default route, '0.0.0.0', rather
than the new lease address.

Populating egress group works this time.

Problem found the hard way by Chris Smith.

Revision 1.59 / (download) - annotate - [select for diffs], Sun Jun 9 00:30:06 2013 UTC (11 years ago) by krw
Branch: MAIN
Changes since 1.58: +1 -4 lines
Diff to previous 1.58 (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.58 / (download) - annotate - [select for diffs], Tue Jun 4 21:04:51 2013 UTC (11 years ago) by krw
Branch: MAIN
Changes since 1.57: +4 -1 lines
Diff to previous 1.57 (colored)

Add support for static routes option (33) and classless static
routes option (121).

ok sthen@

Revision 1.57 / (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.56: +7 -7 lines
Diff to previous 1.56 (colored)

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

Revision 1.56 / (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.55: +7 -14 lines
Diff to previous 1.55 (colored)

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

Revision 1.55 / (download) - annotate - [select for diffs], Fri Mar 22 23:58:51 2013 UTC (11 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.54: +15 -1 lines
Diff to previous 1.54 (colored)

Ignore client-identifier option in leases from a server. They're not supposed
to be there! Instead, always record the client-identifier used to obtain
the lease. Ignore recorded leases that have a different client-identifier
than the one currently in force. If a client-identifier is not specified
in the dhclient.conf file, construct one from the network type and
MAC, like most other clients out there do these days.

Thus, if one plugs in a different USB network adapter, renewing the
previous lease (which upsets servers due to the MAC being different)
is skipped and DISCOVER is attempted at once.

Issue noted and fix tested by tedu@.

Revision 1.54 / (download) - annotate - [select for diffs], Thu Mar 21 12:41:12 2013 UTC (11 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored)

Free lease with free_client_lease() rather than free().

Revision 1.53 / (download) - annotate - [select for diffs], Sat Feb 9 23:37:21 2013 UTC (11 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.52: +5 -8 lines
Diff to previous 1.52 (colored)

As tedu@ pointed out a while ago, it makes little sense to discard
an option list if it contains duplicate option names. Just ignore
the duplicates.

Revision 1.52 / (download) - annotate - [select for diffs], Fri Feb 1 20:44:00 2013 UTC (11 years, 4 months ago) by florian
Branch: MAIN
Changes since 1.51: +2 -1 lines
Diff to previous 1.51 (colored)

do not leak lease in error path; found by llvm
ok krw@

Revision 1.51 / (download) - annotate - [select for diffs], Wed Jan 2 01:06:57 2013 UTC (11 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.50: +1 -9 lines
Diff to previous 1.50 (colored)

Delete misleading comment and a pointless check of !ifi. Since ifi
is either successfully calloc'd or dhclient dies early.

Revision 1.50 / (download) - annotate - [select for diffs], Tue Dec 4 19:24:02 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.49: +7 -9 lines
Diff to previous 1.49 (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.49 / (download) - annotate - [select for diffs], Tue Nov 27 18:52:39 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.48: +17 -14 lines
Diff to previous 1.48 (colored)

Clean up parsing of option lists. Part 7 (and final).

Allow 'request ;', 'require ;' and 'ignore ;' as requests to create
empty lists of options. Thus enabling the removal of built-in lists
or the removal of global lists inside an 'interface' declaration.

Revision 1.48 / (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.47: +10 -7 lines
Diff to previous 1.47 (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.47 / (download) - annotate - [select for diffs], Tue Nov 27 14:14:16 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.46: +16 -11 lines
Diff to previous 1.46 (colored)

Clean up parsing of option lists. Part 5.

Don't toss away an existing request/require list unless the new
list is successfully parsed.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Nov 25 16:45:31 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.45: +11 -2 lines
Diff to previous 1.45 (colored)

Clean up parsing of option lists. Part 3.

Storing an option in a list more than once is silly, wastes space
and is possibly confusing to sensitive dhcp servers. Make it a
syntax error to attempt to store an option in a list more than once.

Revision 1.45 / (download) - annotate - [select for diffs], Sun Nov 25 14:56:55 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.44: +8 -3 lines
Diff to previous 1.44 (colored)

Clean up parsing of option lists. Part 2.

DHO_PAD ("pad") and DHO_END ("option-end") are not really options
and it makes no sense to require, request, or ignore them. And
probably would confuse some sensitive dhcp servers.

Revision 1.44 / (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.43: +13 -9 lines
Diff to previous 1.43 (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.43 / (download) - annotate - [select for diffs], Thu Nov 8 21:32:55 2012 UTC (11 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.42: +10 -9 lines
Diff to previous 1.42 (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.42 / (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.41: +1 -6 lines
Diff to previous 1.41 (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.41 / (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.40: +6 -5 lines
Diff to previous 1.40 (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.40 / (download) - annotate - [select for diffs], Sun Aug 26 23:33:29 2012 UTC (11 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (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.39 / (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.38: +6 -1 lines
Diff to previous 1.38 (colored)

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

Revision 1.38 / (download) - annotate - [select for diffs], Sat Dec 10 17:15:27 2011 UTC (12 years, 6 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.37: +10 -15 lines
Diff to previous 1.37 (colored)

Tweak parsing. No need to declare, assign and then ignore the token
value when only the token id is required.

Revision 1.37 / (download) - annotate - [select for diffs], Mon Apr 4 11:14:52 2011 UTC (13 years, 2 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.36: +4 -54 lines
Diff to previous 1.36 (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.36 / (download) - annotate - [select for diffs], Sun Jul 19 00:18:02 2009 UTC (14 years, 10 months ago) by stevesk
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.35: +3 -8 lines
Diff to previous 1.35 (colored)

use addr_eq() where we can; ok krw@

Revision 1.35 / (download) - annotate - [select for diffs], Wed May 27 15:04:34 2009 UTC (15 years ago) by stevesk
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.34: +3 -2 lines
Diff to previous 1.34 (colored)

add missing else; from ISC.
this fixes an old, old bug that could cause lease entries to be lost
when initially loading client leases.  found while looking for another
issue.
ok krw@

Revision 1.34 / (download) - annotate - [select for diffs], Wed Feb 14 23:19:26 2007 UTC (17 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

spacing and a typo that fell out of the read

Revision 1.33 / (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.32: +15 -18 lines
Diff to previous 1.32 (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.32 / (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.31: +18 -23 lines
Diff to previous 1.31 (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.31 / (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.30: +2 -4 lines
Diff to previous 1.30 (colored)

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

Revision 1.30 / (download) - annotate - [select for diffs], Fri Dec 15 14:56:38 2006 UTC (17 years, 5 months ago) by stevesk
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

KNF

Revision 1.29 / (download) - annotate - [select for diffs], Mon May 8 17:25:59 2006 UTC (18 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.28: +5 -1 lines
Diff to previous 1.28 (colored)

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

Revision 1.28 / (download) - annotate - [select for diffs], Thu Apr 20 15:54:34 2006 UTC (18 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.27: +19 -15 lines
Diff to previous 1.27 (colored)

adjust comments as to what keywords are legal; from fkr

Revision 1.27 / (download) - annotate - [select for diffs], Tue Apr 18 19:17:54 2006 UTC (18 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.26: +61 -61 lines
Diff to previous 1.26 (colored)

cleanup keyword lookup for the lexer, and remove keywords not valid in
either dhclient or dhcpd context; tested by many

Revision 1.26 / (download) - annotate - [select for diffs], Tue Aug 2 02:34:03 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.25: +59 -147 lines
Diff to previous 1.25 (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.25 / (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.24: +2 -2 lines
Diff to previous 1.24 (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.24 / (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.23: +26 -28 lines
Diff to previous 1.23 (colored)

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

ok henning@

Revision 1.23 / (download) - annotate - [select for diffs], Fri Jul 15 22:33:04 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.22: +4 -6 lines
Diff to previous 1.22 (colored)

Fix handling of comma separated option value lists, broken in r1.20.

Found and fix tested by Moritz Jodeit.

Revision 1.22 / (download) - annotate - [select for diffs], Mon Jul 11 18:24:08 2005 UTC (18 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

spacing

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

Expunge unused hashing code and variables.

Revision 1.20 / (download) - annotate - [select for diffs], Mon Jul 11 17:57:26 2005 UTC (18 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.19: +16 -14 lines
Diff to previous 1.19 (colored)

Dispense with the overhead of creating a hash just to lookup the
option name. Just iterate over the 256 option names. Only the first 80
or so are used anyway. Eliminating now unused hash code will follow.

ok henning@ millert@ beck@

Revision 1.19 / (download) - annotate - [select for diffs], Sat Jul 9 01:06:00 2005 UTC (18 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.18: +4 -47 lines
Diff to previous 1.18 (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.18 / (download) - annotate - [select for diffs], Wed Sep 15 18:15:18 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.17: +4 -4 lines
Diff to previous 1.17 (colored)

no \n in error() calls and minor KNF, from Moritz Jodeit <moritz@jodeit.org>

Revision 1.17 / (download) - annotate - [select for diffs], Tue Aug 24 15:06:03 2004 UTC (19 years, 9 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.16: +11 -13 lines
Diff to previous 1.16 (colored)

revert r1.16, dhclient has to work without a config file at least on the
install media, theo ok

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jul 4 23:33:49 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.15: +13 -11 lines
Diff to previous 1.15 (colored)

properly bitch when we cannot open the config file, basically resembling
a diff from Damir Horvat <damir@x-si.org> which didn't apply cleanly

Revision 1.15 / (download) - annotate - [select for diffs], Thu May 13 07:35:17 2004 UTC (20 years, 1 month ago) by wilfried
Branch: MAIN
Changes since 1.14: +2 -1 lines
Diff to previous 1.14 (colored)

don't leave this file open, ok henning@

Revision 1.14 / (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.13: +3 -3 lines
Diff to previous 1.13 (colored)

do not overload libc function names causing linker troubles

Revision 1.13 / (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.12: +2 -2 lines
Diff to previous 1.12 (colored)

more shrink and lint fixes; henning ok

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

more pruning; henning ok

Revision 1.11 / (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.10: +1 -3 lines
Diff to previous 1.10 (colored)

zap interface flags

Revision 1.10 / (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.9: +28 -35 lines
Diff to previous 1.9 (colored)

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

Revision 1.9 / (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.8: +2 -1 lines
Diff to previous 1.8 (colored)

remove dummy_interfaces and fallback_interface gunk

Revision 1.8 / (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.7: +1 -2 lines
Diff to previous 1.7 (colored)

cut unreachable code

Revision 1.7 / (download) - annotate - [select for diffs], Sat Feb 7 21:10:26 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

it's a little sad that this beast has only one asprintf, and that one
just mimics a strdup... so make it a strdup. spotted by theo

Revision 1.6 / (download) - annotate - [select for diffs], Sat Feb 7 11:35:59 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.5: +116 -99 lines
Diff to previous 1.5 (colored)

more style fixes from Emil Mikulic <emikulic@dmr.ath.cx>
Thank you very much for this excellent work, it helps a lot.
binary unchanged.
I am still convinced dhclient can be made readable.

Revision 1.5 / (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.4: +2 -2 lines
Diff to previous 1.4 (colored)

$OpenBSD$, tedu

Revision 1.4 / (download) - annotate - [select for diffs], Wed Feb 4 01:50:22 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.3: +19 -19 lines
Diff to previous 1.3 (colored)

more KNF

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

asprintf

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: +449 -526 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.