summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcpd/dhcpd.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use pw->pw_dir when chroot'ing, not _PATH_VAREMPTY.krw2019-08-061-4/+3
| | | | | | | Brings various dhcp related daemons into line with the common idiom. ok florian@
* Bring parse_warn() into the log.[ch] 21st century and adopt the "^"krw2017-02-161-4/+1
| | | | placement logic from dhclient.
* Eliminate pointless'%m' (a.k.a. hand rolled strerror()) by using fatal() andkrw2017-02-131-7/+7
| | | | log_warn(). Zap a couple of explicit 'syslog()' calls.
* Adjust some long lines.krw2017-02-131-6/+7
|
* Switch from old errwarn.c logging to shiny new log.[ch].krw2017-02-131-18/+20
| | | | ok benno@
* Pull in <time.h> for one or more of gmtime, strftime, strptime, time,guenther2016-08-271-1/+2
| | | | | | timegm, and tzset ok deraadt@
* Remove pledge(2)'s that are called before chroot(2) since in the near futuremestre2016-04-271-6/+2
| | | | | | | this will be forbidden. The remaining pledge(2) calls after chroot(2) are still kept. OK semarie@ "it is time now"
* Eliminate #include inside *.h files and include only needed headers inkrw2016-02-061-3/+20
| | | | | | | each *.c file. Inspired by mention of header silliness by Edgar Pettijohn and mmcc@ on tech@.
* pledge.krw2015-12-141-10/+23
| | | | Diff from Ricardo Mestre. Test report from sthen@.
* Keep track of the last time we scanned the leases to find expiredkrw2015-02-101-6/+6
| | | | | | | ones that needed to be booted out of the pf table process. This avoids removing the same addess over and over. Problem report and original diff from Bertrand Provost.
* Close appropriate ends of pfpipe. Lets pf table process die when dhcpdkrw2015-02-071-1/+3
| | | | | | | | does. Pointed out by Bertrand Provost. ok henning@
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-3/+5
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* Add -u option to bind UDP port as a socket to answer DHCPINFORM fromyasuoka2014-07-111-7/+21
| | | | | | | the clients on non ethernet interfaces (eg. tun(4) or pppx(4)). input krw ok krw
* back out the previous ICMP simplifying diff, it caused livelocks.pelikan2014-05-071-2/+2
| | | | | reported by Mikolaj Kucharski, thanks! ok krw
* Don't call the BOOTP handler indirectly.pelikan2014-05-051-2/+1
| | | | ok krw
* Don't call the ICMP handler indirectly + clean up a bit.pelikan2014-05-051-2/+2
| | | | ok krw
* We run getopt() twice to know if dhcp-sync is used. To make this workclaudio2010-12-151-2/+2
| | | | | | | both getopt calls need the same optstring or the first getopt() call will end before parsing all arguments. Problem found and fixed supplied by m_athias OK millert@, deraadt@
* Fix the naming of interfaces and variables for rdomains and rtablesguenther2010-07-031-3/+3
| | | | | | | | | | | | and make it possible to bind sockets (including listening sockets!) to rtables and not just rdomains. This changes the name of the system calls, socket option, and ioctl. After building with this you should remove the files /usr/share/man/cat2/[gs]etrdomain.0. Since this removes the existing [gs]etrdomain() system calls, the libc major is bumped. Written by claudio@, criticized^Wcritiqued by me
* If interfaces are specified, get their rdomain and bind dhcpd into the sameclaudio2010-04-191-7/+11
| | | | | domain with setrdomain(). This allows to run dhcpd on multiple rdomains. OK krw@
* appease stupid stupid gcc; ok millertderaadt2008-05-291-2/+2
|
* Don't error out if dhcpd-sync does not exist in /etc/services and nomillert2008-05-251-7/+21
| | | | sync options were specified. OK deraadt@
* this should really only be in one file.beck2008-05-081-2/+1
|
* Add synchronisation support for dhcpd - this allows for two dhcpd'sbeck2008-05-071-5/+34
| | | | | | | | 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@
* add missing space between argument names and ellipsissobrado2007-12-301-2/+2
| | | | ok jmc@
* use 1 vs. -1 for true; ok henning@ krw@stevesk2007-07-241-3/+3
|
* -q flag is unused (old shared code from dhclient); spotted by mark@cyodesignsderaadt2007-02-171-4/+2
| | | | ok krw
* no code for -p, so remove from man page and usage();jmc2007-02-171-2/+2
| | | | | confirmed by ckuethe; spotted by Mark Lumsden
* small header cleanup:stevesk2006-11-221-2/+3
| | | | | | | remove uneeded header use <foo.h> not "foo.h" for system include no binary change; ok henning@
* sort options;jmc2006-06-141-2/+2
|
* This diff allows dhcpd to put active leases into a pf table. Dhcpd will thenckuethe2006-06-141-5/+49
| | | | | | | | periodically - based on the length of the shortest lease time - walk across all leases searching for expired leases which are then removed from the pf table. ok henning
* Sort options in usage. From jmc.ckuethe2006-06-011-5/+5
| | | | ok henning@
* This diff makes dhcpd able to manipulate pf tables on certain lease events.ckuethe2006-05-311-6/+38
| | | | | | | | | | | | | dhcpd is now able to place abandoned addresses into a table (to offer some protection against machines camping on an address) and remove them from the table if they are properly leased. When dhcpd assigns an IP to a new hardware address, it can remove that address from a table. This is for use with the overload table in pf; newly arrived machines will not be punished for the actions of a machine that went away. beck@ and krw@ liked previous versions of this, henning@ final ok
* If a list of interfaces is supplied via the command line orkrw2006-05-111-3/+2
| | | | | | | | | | | | | | | | | | | | dhcpd.interfaces then a) don't bother looking up information on interfaces that were not requested; b) don't exit if a requested interface is not found, just issue a warning message; c) exit if none of the interfaces were found. The command line for dhcpd shown in ps will continue to show requested but ignored interfaces. As usual with dhc* code, whack a bunch of unused states, constants, flags, etc. Since we only invoke discover_interfaces() with DISCOVER_SERVER, there is no need to keep track of other possibilities.
* -endpwenthenning2005-05-231-2/+1
|
* more setres[ug]id; ok deraadt@djm2005-05-021-3/+3
|
* change the undocumented -t flag to -n used for configuration testingcanacar2004-10-311-15/+9
| | | | | and document it. cleanup some unused/unneeded variables while there. idea & ok henning@
* avoid aliasing with libc functions; ok henningderaadt2004-09-161-4/+4
|
* Avoid following a NULL pointer if a hostname lookup fails andmillert2004-09-091-2/+2
| | | | | remove an extraneous "exiting" when there is a config file error. OK henning@ and mcbride@
* like always I missed tzset(); Ben Lovett <ben@tilderoot.com>henning2004-05-121-1/+3
|
* remove things not used, spotted by lint mostly; ok henningderaadt2004-05-041-4/+1
|
* filter writes and lock bpf descriptor, ok henning@canacar2004-04-211-5/+6
|
* fix the error message in case the _dhcp user does not existhenning2004-04-211-2/+2
|
* don't allow the port to be changed here eitherhenning2004-04-201-20/+5
|
* various knf; henning okderaadt2004-04-181-8/+7
|
* dhcpd may be invoked without any interface givenhenning2004-04-181-4/+1
|
* a bunch of knf, ok henningderaadt2004-04-161-2/+2
|
* chroot and drop privileges after startuphenning2004-04-151-1/+16
|
* - trim/update AUTHORSjmc2004-04-151-3/+3
| | | | | | | - standard options list and correct SYNOPSIS for dhcpd(8) - sync usage() ok henning@
* spacesderaadt2004-04-141-3/+3
|
* KNF, ansi and suchhenning2004-04-141-58/+43
|