OpenBSD CVS

CVS log for src/usr.sbin/dhcpd/options.c


[BACK] Up to [local] / src / usr.sbin / dhcpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.35 / (download) - annotate - [select for diffs], Mon Feb 13 22:33:39 2017 UTC (7 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, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, HEAD
Changes since 1.34: +7 -4 lines
Diff to previous 1.34 (colored)

Adjust some long lines.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Feb 13 19:13:14 2017 UTC (7 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.33: +10 -9 lines
Diff to previous 1.33 (colored)

Switch from old errwarn.c logging to shiny new log.[ch].

ok benno@

Revision 1.33 / (download) - annotate - [select for diffs], Tue Nov 15 10:49:37 2016 UTC (7 years, 6 months ago) by mestre
Branch: MAIN
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

Replace bzero(3) with memset(3)

"Looks good" to deraadt@

Revision 1.32 / (download) - annotate - [select for diffs], Tue Oct 4 22:47:51 2016 UTC (7 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.31: +4 -4 lines
Diff to previous 1.31 (colored)

Zap stray whitespace.

Revision 1.31 / (download) - annotate - [select for diffs], Fri Aug 5 14:02:23 2016 UTC (7 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.30: +2 -9 lines
Diff to previous 1.30 (colored)

Don't leak the option data of non-DHCPINFORM messages received on
the udp socket.

Found by David Carlier.

ok yasuoka@

Revision 1.30 / (download) - annotate - [select for diffs], Sat Feb 6 23:50:10 2016 UTC (8 years, 4 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.29: +13 -2 lines
Diff to previous 1.29 (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.29 / (download) - annotate - [select for diffs], Sat Jun 27 14:29:39 2015 UTC (8 years, 11 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.28: +27 -1 lines
Diff to previous 1.28 (colored)

Do not send routers (option 3) or static routes (option 33) when
classless static routes (option 121, 249) are sent. RFC 3442 says
servers SHOULD NOT send those options.

This avoids confusing clients who fail to ignore the routers or
static routes options in the presence of classless static routes
options. RFC 3442 says clients MUST ignore those options.

Incorrect behavior in MS and Linux clients reported by Juan on
misc@.

ok millert@

Revision 1.26.16.1 / (download) - annotate - [select for diffs], Tue Jul 29 18:23:07 2014 UTC (9 years, 10 months ago) by tobias
Branch: OPENBSD_5_4
Changes since 1.26: +2 -3 lines
Diff to previous 1.26 (colored) next main 1.27 (colored)

Fix memory exhaustion occurring on DHCP options with 0 length.

halex@ and krw@ pointed out that a NULL check before free can go, too.

ok deraadt@, halex@, krw@, jasper@

Revision 1.26.20.1 / (download) - annotate - [select for diffs], Tue Jul 29 18:21:30 2014 UTC (9 years, 10 months ago) by tobias
Branch: OPENBSD_5_5
Changes since 1.26: +2 -3 lines
Diff to previous 1.26 (colored) next main 1.27 (colored)

Fix memory exhaustion occurring on DHCP options with 0 length.

halex@ and krw@ pointed out that a NULL check before free can go, too.

ok deraadt@, halex@, krw@, jasper@

Revision 1.28 / (download) - annotate - [select for diffs], Mon Jul 28 16:45:35 2014 UTC (9 years, 10 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.27: +2 -3 lines
Diff to previous 1.27 (colored)

Fix memory exhaustion occurring on DHCP options with 0 length.

halex@ and krw@ pointed out that a NULL check before free can go, too.

ok deraadt@, halex@, krw@

Revision 1.27 / (download) - annotate - [select for diffs], Fri Jul 11 09:42:27 2014 UTC (9 years, 11 months ago) by yasuoka
Branch: MAIN
Changes since 1.26: +9 -1 lines
Diff to previous 1.26 (colored)

Add -u option to bind UDP port as a socket to answer DHCPINFORM from
the clients on non ethernet interfaces (eg. tun(4) or pppx(4)).

input krw
ok krw

Revision 1.26 / (download) - annotate - [select for diffs], Sat Jan 2 04:21:16 2010 UTC (14 years, 5 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_4_BASE, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Branch point for: OPENBSD_5_5, OPENBSD_5_4
Changes since 1.25: +4 -4 lines
Diff to previous 1.25 (colored)

Eliminate all uses of dmalloc() where the returned pointer
is checked for NULL and a specific error/warning issued. Add
two such manual warning/error checks and kill those dmalloc
calls. And then there were none, so kill dmalloc(). Whew.

Revision 1.25 / (download) - annotate - [select for diffs], Fri Jan 1 20:46:20 2010 UTC (14 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.24: +3 -4 lines
Diff to previous 1.24 (colored)

Eliminate all uses of dfree() where the pointer is either dereferenced
immediately before the use or the pointer is checked for NULL before
the call. And then there were none, so kill dfree().

Revision 1.21.2.1 / (download) - annotate - [select for diffs], Sun Nov 16 06:04:11 2008 UTC (15 years, 6 months ago) by brad
Branch: OPENBSD_4_4
Changes since 1.21: +31 -17 lines
Diff to previous 1.21 (colored) next main 1.22 (colored)

rev 1.24
Sigh. Some clients can't handle three DHO_PAD options holding space
for an unused overload option. Noticed by mk@ when netbooting his
G4 mac mini.

So compact the options by shifting them over the unused option and
filling the end by DHO_PAD.

rev 1.23
Some clients don't parse a DHO_DHCP_OPTION_OVERLOAD option the way
I expected. They object if there are no bits set in the option
value. So just use DHO_PAD in the reserved space unless at least
one of the bits is set.

rev 1.22
bzero' the option buffer with the correct buffer size.  this fixes
incomplete buffer initialization and possible incorrect option
handling.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Nov 14 02:00:08 2008 UTC (15 years, 6 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.23: +21 -10 lines
Diff to previous 1.23 (colored)

Sigh. Some clients can't handle three DHO_PAD options holding space
for an unused overload option. Noticed by mk@ when netbooting his
G4 mac mini.

So compact the options by shifting them over the unused option and
filling the end by DHO_PAD.

Tested by mk@.

Revision 1.23 / (download) - annotate - [select for diffs], Sat Nov 8 01:42:24 2008 UTC (15 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.22: +14 -12 lines
Diff to previous 1.22 (colored)

Some clients don't parse a DHO_DHCP_OPTION_OVERLOAD option the way
I expected. They object if there are no bits set in the option
value. So just use DHO_PAD in the reserved space unless at least
one of the bits is set.

Various versions tested by Tobias Ulmer on OpenSolaris, matthieu@
on busybox's DHCP client, and Uwe Dippel on Solaris. All of which
failed before.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Sep 10 00:22:49 2008 UTC (15 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.21: +5 -4 lines
Diff to previous 1.21 (colored)

bzero' the option buffer with the correct buffer size.  this fixes
incomplete buffer initialization and possible incorrect option
handling.

Thanks to Nick Bender
ok krw@ deraadt@

Revision 1.21 / (download) - annotate - [select for diffs], Wed Apr 16 00:36:48 2008 UTC (16 years, 1 month ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE
Branch point for: OPENBSD_4_4
Changes since 1.20: +72 -69 lines
Diff to previous 1.20 (colored)

Redo/clarify the logic for storing options in the various buffers.

While there, bail out quickly if no options can be stored, and avoid
overflow buffers if building a bootp reply.

Henning looked and didn't get upset. millert@ tested it for a few
days and liked the look of it. canacar@ glanced at it.

Revision 1.20 / (download) - annotate - [select for diffs], Fri Jan 18 20:14:03 2008 UTC (16 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

Call store_options() with correct cutoff values, i.e. ones not 7 bytes
too large. Fixes a problem where a nicely crafted packet could crash
dhcpd. Nuke a superfluous declaration of store_options() while here.

Problem found and fix tested by Peter Hessler.

ok beck@ millert@ henning@

Revision 1.19 / (download) - annotate - [select for diffs], Mon Oct 29 16:51:02 2007 UTC (16 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.18: +68 -50 lines
Diff to previous 1.18 (colored)

More tweaking of option processing, this time around the creation of
the priority list. Add create_priority_list() and use it to
consistantly merge mandatory, supplied and default option priority
lists into a reliable and complete list of options sorted by priority.
No intended functional change other than ensuring all options
available are returned.

"looks good" henning@ "OK, fair enough" millert@

Revision 1.18 / (download) - annotate - [select for diffs], Sat Oct 27 14:47:38 2007 UTC (16 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.17: +70 -78 lines
Diff to previous 1.17 (colored)

Rework option storing so the code is readable, and eliminate odd
behaviour on several edge conditions.

Feedback, suggestion & "I like the approach" millert@
"excellent" henning@.

Revision 1.17 / (download) - annotate - [select for diffs], Sun Oct 21 13:12:31 2007 UTC (16 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.16: +5 -5 lines
Diff to previous 1.16 (colored)

Take even more care to ensure the max message size is at
least as large as the minimum IP MTU.

ok canacar@ henning@ millert@

Revision 1.16 / (download) - annotate - [select for diffs], Sun Oct 21 01:08:17 2007 UTC (16 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.15: +14 -19 lines
Diff to previous 1.15 (colored)

Last bit of (planned) tidy up in cons_options(). Join some lines,
delete some blank lines, add some other blank lines, move expressions
so calculations done only once. Eliminate extraneous ++'s.

No functional change.

Revision 1.15 / (download) - annotate - [select for diffs], Sun Oct 21 00:39:28 2007 UTC (16 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.14: +39 -37 lines
Diff to previous 1.14 (colored)

Tidy up, make usual case exit faster, eliminate variable. No functional
change.

ok beck@

Revision 1.14 / (download) - annotate - [select for diffs], Fri Oct 19 15:52:20 2007 UTC (16 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.13: +3 -2 lines
Diff to previous 1.13 (colored)

Make sure bufix is updated after copying options into the first overflow
buffer. Actually use the second overflow buffer now that bufix is correct
and the test for remaining options will work correctly.

ok beck@

Revision 1.13 / (download) - annotate - [select for diffs], Fri Oct 19 15:43:33 2007 UTC (16 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.12: +8 -6 lines
Diff to previous 1.12 (colored)

Be a bit more paranoid and initialize all valid options buffers with
DHO_PAD (a.k.a. 0). Eliminate manual DHO_PAD'ing after DHO_END is put
into the buffer.

ok beck@

Revision 1.12 / (download) - annotate - [select for diffs], Fri Oct 19 15:34:55 2007 UTC (16 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

Fix obvious typos and write DHO_PAD and DHO_END into correct options overflow
buffer. Spotted by canacar@ and others.

ok beck@

Revision 1.11 / (download) - annotate - [select for diffs], Fri Oct 19 15:25:07 2007 UTC (16 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

Correct the value returned by cons_options in the case where overload buffers
are used. It should reflect the end of the main options buffer rather than
the start of the options copied into it.

ok beck@

Revision 1.10 / (download) - annotate - [select for diffs], Fri Oct 19 15:16:34 2007 UTC (16 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

Ensure that main_buffer_size is set to a value less than or equal to
the size of the outgoing packet's options field. Spotted by canacar@.

ok beck@

Revision 1.8.4.1 / (download) - annotate - [select for diffs], Wed Oct 10 06:10:27 2007 UTC (16 years, 8 months ago) by ckuethe
Branch: OPENBSD_4_2
Changes since 1.8: +5 -2 lines
Diff to previous 1.8 (colored) next main 1.9 (colored)

merge fix from current, prompted by deraadt. original commit message:
"Minimum IP MTU" means what it says. Ensure that packets returned by
dhcpd are the minimum size or larger no matter what the client thinks
the minimum allowable size is. Found by Nahuel Riva and Gera Richarte.
Fix by millert@.

Revision 1.8.2.1 / (download) - annotate - [select for diffs], Tue Oct 9 16:46:31 2007 UTC (16 years, 8 months ago) by ckuethe
Branch: OPENBSD_4_1
Changes since 1.8: +5 -2 lines
Diff to previous 1.8 (colored) next main 1.9 (colored)

merge fix from current, prompted by deraadt. original commit message:
"Minimum IP MTU" means what it says. Ensure that packets returned by
dhcpd are the minimum size or larger no matter what the client thinks
the minimum allowable size is. Found by Nahuel Riva and Gera Richarte.
Fix by millert@.

Revision 1.6.8.1 / (download) - annotate - [select for diffs], Tue Oct 9 16:44:55 2007 UTC (16 years, 8 months ago) by ckuethe
Branch: OPENBSD_4_0
Changes since 1.6: +5 -2 lines
Diff to previous 1.6 (colored) next main 1.7 (colored)

merge fix from current, prompted by deraadt. original commit message:
"Minimum IP MTU" means what it says. Ensure that packets returned by
dhcpd are the minimum size or larger no matter what the client thinks
the minimum allowable size is. Found by Nahuel Riva and Gera Richarte.
Fix by millert@.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Oct 9 03:17:34 2007 UTC (16 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.8: +5 -2 lines
Diff to previous 1.8 (colored)

"Minimum IP MTU" means what it says. Ensure that packets returned by
dhcpd are the minimum size or larger no matter what the client thinks
the minimum allowable size is. Found by Nahuel Riva and Gera Richarte.
Fix by millert@.

Revision 1.8 / (download) - annotate - [select for diffs], Fri Dec 15 14:09:13 2006 UTC (17 years, 5 months ago) by stevesk
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_1_BASE
Branch point for: OPENBSD_4_2, OPENBSD_4_1
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

typo in comment

Revision 1.7 / (download) - annotate - [select for diffs], Tue Dec 12 19:38:55 2006 UTC (17 years, 6 months ago) by stevesk
Branch: MAIN
Changes since 1.6: +1 -2 lines
Diff to previous 1.6 (colored)

remove unused #defines; no binary change

Revision 1.6 / (download) - annotate - [select for diffs], Tue Sep 21 04:07:04 2004 UTC (19 years, 8 months ago) by david
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Branch point for: OPENBSD_4_0
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

spelling fixes; ok jmc@ henning@

Revision 1.5 / (download) - annotate - [select for diffs], Thu Sep 16 18:35:43 2004 UTC (19 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.4: +8 -8 lines
Diff to previous 1.4 (colored)

avoid aliasing with libc functions; ok henning

Revision 1.4 / (download) - annotate - [select for diffs], Tue May 4 21:25:27 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.3: +1 -248 lines
Diff to previous 1.3 (colored)

remove DEBUG_PACKET stuff; henning ok

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

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

Revision 1.2 / (download) - annotate - [select for diffs], Wed Apr 14 01:27:49 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.1: +360 -364 lines
Diff to previous 1.1 (colored)

the ones from dhclient do, and they're already KNF'd and annsified...

Revision 1.1 / (download) - annotate - [select for diffs], Tue Apr 13 23:41:48 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN

may the whacking begin

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.