summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd
AgeCommit message (Collapse)Author
2010-04-19If interfaces are specified, get their rdomain and bind dhcpd into the sameClaudio Jeker
domain with setrdomain(). This allows to run dhcpd on multiple rdomains. OK krw@
2010-04-02plug memory leaks on error pathszinovik
joint work with krw@ ok krw@, stsp@
2010-03-29Initialize 'flags' field of tree_cache stack variables to 0. Paranoia.Kenneth R Westerback
2010-03-29Always put server id in NAK's to requests. Some router/switchesKenneth R Westerback
need this, as reported in PR#6339. Fix tested by submitter, Marcel Widget, who also supplied the diff that I tweaked. ok beck@
2010-03-27malloc/strlcpy -> strdup. Use consistent idiom.Kenneth R Westerback
ok (as part of larger diff) blambert@ kettenis@ stsp@ zinovik@
2010-01-03unused prototypeTheo de Raadt
2010-01-02Eliminate all uses of dmalloc() where the returned pointerKenneth R Westerback
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.
2010-01-01Eliminate all uses of dfree() where the pointer is either dereferencedKenneth R Westerback
immediately before the use or the pointer is checked for NULL before the call. And then there were none, so kill dfree().
2010-01-01Wrappers around a wrapper around free() are of no more use thanKenneth R Westerback
wrappers around wrappers around calloc(). The purpose of the free() wrapper is to generate an error message when free'ing NULL. But free_hash_bucket(), free_lease(), and free_tree() are all called immediately after dereferencing the pointer to be freed. Thus the error message will never be issued.
2010-01-01A slightly more complex calloc() wrapper wrapper, new_hash_table(),Kenneth R Westerback
bites the dust.
2010-01-01Another calloc() wrapper wrapper, new_tree(), bites the dust.Kenneth R Westerback
2010-01-01Two more calloc() wrapper wrappers, new_shared_network() andKenneth R Westerback
new_subnet(), bite the dust.
2010-01-01Single-use wrapper functions that just call a wrapper functionKenneth R Westerback
around calloc() and end up producing duplicate error messages are just confusing. Eliminate new_hash_bucket(), new_lease(), new_leases(), new_group().
2010-01-01Delete unused declarations.Kenneth R Westerback
2010-01-01Plug a potential leak similar to the one parfait spotted and TheoKenneth R Westerback
fixed. Eliminate the function new_class() by expanding the only use Use strdup() and calloc() rather than manually simulating them. No functional change.
2009-12-14Just like dhclient(8), we use the bpf filter drop to preventMarco Pfatschbacher
us from sending an icmp error along with the dhcp reply. OK henning@
2009-12-10plug memory leak, spotted by parfait; ok krwTheo de Raadt
2009-09-14fix typo; ok jmc@Ingo Schwarze
also reported upstream to dhcp dash bugs at isc dot org
2009-09-01Echo back the Relay Agent Information option if present (RFC 3046).Reyk Floeter
Also add support for the "ipsec-tunnel" hardware type as described in RFC 3456. ok henning@ krw@ (but needs more testing from others)
2009-08-01subnet-number and netmask could be ip addresses only.Federico G. Schwindt
krw@ jmc@ ok
2009-02-01"Ethernet" is a family of networking technologies developed at Xerox PARC,Igor Sobrado
not a generic name. we must use the right capitalization for this term. ok jmc@
2009-01-13add option 150, voip-configuration-server, as an array of IP addresses;Stuart Henderson
draft-raj-dhc-tftp-addr-option-05, req by Michael van der Westhuizen. ok henning, krw, dlg
2008-11-14Sigh. Some clients can't handle three DHO_PAD options holding spaceKenneth R Westerback
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@.
2008-11-08Some clients don't parse a DHO_DHCP_OPTION_OVERLOAD option the wayKenneth R Westerback
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.
2008-09-15When checking if a syscall like open(), ioctl() or writev() failed compareClaudio Jeker
directly against -1 and do not use a < 0 test. OK henning@
2008-09-10bzero' the option buffer with the correct buffer size. this fixesReyk Floeter
incomplete buffer initialization and possible incorrect option handling. Thanks to Nick Bender ok krw@ deraadt@
2008-07-21Initial stab at DHCPINFORM support. OK phessler@Todd C. Miller
2008-05-30correct size of iov[]; ralf.horstmann@gmx.deTheo de Raadt
2008-05-29appease stupid stupid gcc; ok millertTheo de Raadt
2008-05-25Don't error out if dhcpd-sync does not exist in /etc/services and noTodd C. Miller
sync options were specified. OK deraadt@
2008-05-11fix sync.c to not puke if sync_lease called without sync_init.Bob Beck
from henric.
2008-05-08Insert pad blocks after sub-messages to keep the structures aligned toTheo de Raadt
16 byte boundaries for maximum portability (somewhat similar to CMSG's) ok beck
2008-05-08this should really only be in one file.Bob Beck
2008-05-08don't break dhcpd when not using synch mechanisms..Bob Beck
2008-05-07Add synchronisation support for dhcpd - this allows for two dhcpd'sBob Beck
with the same configuration to be run on the same net and they will keep their lease files/state in synch, and therefore allowing you to run redundant dhcpd's. Synchronization code stolen from spamd, uses an hmac key in /var/db/dhcpd.key if it exists. ok krw@ deraadt@
2008-04-16Redo/clarify the logic for storing options in the various buffers.Kenneth R Westerback
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.
2008-04-04option 144 is commonly used for tftp-config-file.David Gwynne
ok henning@ krw@
2008-03-17option 252 is generally used to specify an autoproxy-script on a subnet.David Gwynne
ok krw@ henning@
2008-01-18Call store_options() with correct cutoff values, i.e. ones not 7 bytesKenneth R Westerback
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@
2007-12-30add missing space between argument names and ellipsisIgor Sobrado
ok jmc@
2007-12-23for "fixed-address", note that no lease is generated; after someJason McIntyre
discussion with krw, who hasn;t ok'd this diff, but we can change it if he doesn;t like it; started by mail from Max Hayden Chiz
2007-12-23remove double word in comment;Jason McIntyre
2007-10-29More tweaking of option processing, this time around the creation ofKenneth R Westerback
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@
2007-10-28Remove duplicate DHO_HOST_NAME entry and add missingKenneth R Westerback
DHO_DHCP_USER_CLASS_ID entry to dhcp_option_default_priority_list[]. Reformat list of numbers at the end of dhcp_option_default_priority_list[] so it is easy to see which options are defined. No functional change.
2007-10-27Rework option storing so the code is readable, and eliminate oddKenneth R Westerback
behaviour on several edge conditions. Feedback, suggestion & "I like the approach" millert@ "excellent" henning@.
2007-10-21Take even more care to ensure the max message size is atKenneth R Westerback
least as large as the minimum IP MTU. ok canacar@ henning@ millert@
2007-10-21Last bit of (planned) tidy up in cons_options(). Join some lines,Kenneth R Westerback
delete some blank lines, add some other blank lines, move expressions so calculations done only once. Eliminate extraneous ++'s. No functional change.
2007-10-21Tidy up, make usual case exit faster, eliminate variable. No functionalKenneth R Westerback
change. ok beck@
2007-10-19Make sure bufix is updated after copying options into the first overflowKenneth R Westerback
buffer. Actually use the second overflow buffer now that bufix is correct and the test for remaining options will work correctly. ok beck@
2007-10-19Be a bit more paranoid and initialize all valid options buffers withKenneth R Westerback
DHO_PAD (a.k.a. 0). Eliminate manual DHO_PAD'ing after DHO_END is put into the buffer. ok beck@