summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcpd/options.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Adjust some long lines.krw2017-02-131-4/+7
|
* Switch from old errwarn.c logging to shiny new log.[ch].krw2017-02-131-9/+10
| | | | ok benno@
* Replace bzero(3) with memset(3)mestre2016-11-151-3/+3
| | | | "Looks good" to deraadt@
* Zap stray whitespace.krw2016-10-041-4/+4
|
* Don't leak the option data of non-DHCPINFORM messages received onkrw2016-08-051-9/+2
| | | | | | | | the udp socket. Found by David Carlier. ok yasuoka@
* Eliminate #include inside *.h files and include only needed headers inkrw2016-02-061-2/+13
| | | | | | | each *.c file. Inspired by mention of header silliness by Edgar Pettijohn and mmcc@ on tech@.
* Do not send routers (option 3) or static routes (option 33) whenkrw2015-06-271-1/+27
| | | | | | | | | | | | | | 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@
* Fix memory exhaustion occurring on DHCP options with 0 length.tobias2014-07-281-3/+2
| | | | | | halex@ and krw@ pointed out that a NULL check before free can go, too. ok deraadt@, halex@, krw@
* Add -u option to bind UDP port as a socket to answer DHCPINFORM fromyasuoka2014-07-111-1/+9
| | | | | | | the clients on non ethernet interfaces (eg. tun(4) or pppx(4)). input krw ok krw
* Eliminate all uses of dmalloc() where the returned pointerkrw2010-01-021-4/+4
| | | | | | 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.
* Eliminate all uses of dfree() where the pointer is either dereferencedkrw2010-01-011-4/+3
| | | | | immediately before the use or the pointer is checked for NULL before the call. And then there were none, so kill dfree().
* Sigh. Some clients can't handle three DHO_PAD options holding spacekrw2008-11-141-10/+21
| | | | | | | | | | 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@.
* Some clients don't parse a DHO_DHCP_OPTION_OVERLOAD option the waykrw2008-11-081-12/+14
| | | | | | | | | | 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.
* bzero' the option buffer with the correct buffer size. this fixesreyk2008-09-101-4/+5
| | | | | | | | incomplete buffer initialization and possible incorrect option handling. Thanks to Nick Bender ok krw@ deraadt@
* Redo/clarify the logic for storing options in the various buffers.krw2008-04-161-70/+73
| | | | | | | | 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.
* Call store_options() with correct cutoff values, i.e. ones not 7 byteskrw2008-01-181-3/+3
| | | | | | | | | 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@
* More tweaking of option processing, this time around the creation ofkrw2007-10-291-50/+68
| | | | | | | | | | 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@
* Rework option storing so the code is readable, and eliminate oddkrw2007-10-271-78/+70
| | | | | | | behaviour on several edge conditions. Feedback, suggestion & "I like the approach" millert@ "excellent" henning@.
* Take even more care to ensure the max message size is atkrw2007-10-211-5/+5
| | | | | | least as large as the minimum IP MTU. ok canacar@ henning@ millert@
* Last bit of (planned) tidy up in cons_options(). Join some lines,krw2007-10-211-19/+14
| | | | | | | delete some blank lines, add some other blank lines, move expressions so calculations done only once. Eliminate extraneous ++'s. No functional change.
* Tidy up, make usual case exit faster, eliminate variable. No functionalkrw2007-10-211-37/+39
| | | | | | change. ok beck@
* Make sure bufix is updated after copying options into the first overflowkrw2007-10-191-2/+3
| | | | | | | buffer. Actually use the second overflow buffer now that bufix is correct and the test for remaining options will work correctly. ok beck@
* Be a bit more paranoid and initialize all valid options buffers withkrw2007-10-191-6/+8
| | | | | | | DHO_PAD (a.k.a. 0). Eliminate manual DHO_PAD'ing after DHO_END is put into the buffer. ok beck@
* Fix obvious typos and write DHO_PAD and DHO_END into correct options overflowkrw2007-10-191-3/+3
| | | | | | buffer. Spotted by canacar@ and others. ok beck@
* Correct the value returned by cons_options in the case where overload bufferskrw2007-10-191-2/+2
| | | | | | | are used. It should reflect the end of the main options buffer rather than the start of the options copied into it. ok beck@
* Ensure that main_buffer_size is set to a value less than or equal tokrw2007-10-191-3/+3
| | | | | | the size of the outgoing packet's options field. Spotted by canacar@. ok beck@
* "Minimum IP MTU" means what it says. Ensure that packets returned bykrw2007-10-091-2/+5
| | | | | | 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@.
* typo in commentstevesk2006-12-151-2/+2
|
* remove unused #defines; no binary changestevesk2006-12-121-2/+1
|
* spelling fixes; ok jmc@ henning@david2004-09-211-2/+2
|
* avoid aliasing with libc functions; ok henningderaadt2004-09-161-8/+8
|
* remove DEBUG_PACKET stuff; henning okderaadt2004-05-041-248/+1
|
* remove things not used, spotted by lint mostly; ok henningderaadt2004-05-041-1/+3
|
* the ones from dhclient do, and they're already KNF'd and annsified...henning2004-04-141-364/+360
|
* may the whacking beginhenning2004-04-131-0/+742