summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd/dhcpd.c
AgeCommit message (Collapse)Author
2024-08-21s/inet_aton/inet_pton/Florian Obser
OK claudio
2023-10-06add -v to usage();Jason McIntyre
2023-10-05Do log output to stderr while running dhcpd(8) in foreground to makeVitaliy Makkoveev
behaviour in accordance with man page. Introduce '-v' option to make output more verbose. Do a little refactoring to make code more consistent with other daemons like ospfd(8), httpd(8), relayd(8), etc. Feedback from bluhm benno ok bluhm
2019-08-06Use pw->pw_dir when chroot'ing, not _PATH_VAREMPTY.Kenneth R Westerback
Brings various dhcp related daemons into line with the common idiom. ok florian@
2017-02-16Bring parse_warn() into the log.[ch] 21st century and adopt the "^"Kenneth R Westerback
placement logic from dhclient.
2017-02-13Eliminate pointless'%m' (a.k.a. hand rolled strerror()) by using fatal() andKenneth R Westerback
log_warn(). Zap a couple of explicit 'syslog()' calls.
2017-02-13Adjust some long lines.Kenneth R Westerback
2017-02-13Switch from old errwarn.c logging to shiny new log.[ch].Kenneth R Westerback
ok benno@
2016-08-27Pull in <time.h> for one or more of gmtime, strftime, strptime, time,Philip Guenther
timegm, and tzset ok deraadt@
2016-04-27Remove pledge(2)'s that are called before chroot(2) since in the near futureRicardo Mestre
this will be forbidden. The remaining pledge(2) calls after chroot(2) are still kept. OK semarie@ "it is time now"
2016-02-06Eliminate #include inside *.h files and include only needed headers inKenneth R Westerback
each *.c file. Inspired by mention of header silliness by Edgar Pettijohn and mmcc@ on tech@.
2015-12-14pledge.Kenneth R Westerback
Diff from Ricardo Mestre. Test report from sthen@.
2015-02-10Keep track of the last time we scanned the leases to find expiredKenneth R Westerback
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.
2015-02-07Close appropriate ends of pfpipe. Lets pf table process die when dhcpdKenneth R Westerback
does. Pointed out by Bertrand Provost. ok henning@
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
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)
2014-07-11Add -u option to bind UDP port as a socket to answer DHCPINFORM fromYASUOKA Masahiko
the clients on non ethernet interfaces (eg. tun(4) or pppx(4)). input krw ok krw
2014-05-07back out the previous ICMP simplifying diff, it caused livelocks.Martin Pelikan
reported by Mikolaj Kucharski, thanks! ok krw
2014-05-05Don't call the BOOTP handler indirectly.Martin Pelikan
ok krw
2014-05-05Don't call the ICMP handler indirectly + clean up a bit.Martin Pelikan
ok krw
2010-12-15We run getopt() twice to know if dhcp-sync is used. To make this workClaudio Jeker
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@
2010-07-03Fix the naming of interfaces and variables for rdomains and rtablesPhilip Guenthe
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
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@
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-08this should really only be in one file.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@
2007-12-30add missing space between argument names and ellipsisIgor Sobrado
ok jmc@
2007-07-24use 1 vs. -1 for true; ok henning@ krw@Kevin Steves
2007-02-17-q flag is unused (old shared code from dhclient); spotted by mark@cyodesignsTheo de Raadt
ok krw
2007-02-17no code for -p, so remove from man page and usage();Jason McIntyre
confirmed by ckuethe; spotted by Mark Lumsden
2006-11-22small header cleanup:Kevin Steves
remove uneeded header use <foo.h> not "foo.h" for system include no binary change; ok henning@
2006-06-14sort options;Jason McIntyre
2006-06-14This diff allows dhcpd to put active leases into a pf table. Dhcpd will thenChris Kuethe
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
2006-06-01Sort options in usage. From jmc.Chris Kuethe
ok henning@
2006-05-31This diff makes dhcpd able to manipulate pf tables on certain lease events.Chris Kuethe
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
2006-05-11If a list of interfaces is supplied via the command line orKenneth R Westerback
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.
2005-05-23-endpwentHenning Brauer
2005-05-02more setres[ug]id; ok deraadt@Damien Miller
2004-10-31change the undocumented -t flag to -n used for configuration testingCan Erkin Acar
and document it. cleanup some unused/unneeded variables while there. idea & ok henning@
2004-09-16avoid aliasing with libc functions; ok henningTheo de Raadt
2004-09-09Avoid following a NULL pointer if a hostname lookup fails andTodd C. Miller
remove an extraneous "exiting" when there is a config file error. OK henning@ and mcbride@
2004-05-12like always I missed tzset(); Ben Lovett <ben@tilderoot.com>Henning Brauer
2004-05-04remove things not used, spotted by lint mostly; ok henningTheo de Raadt
2004-04-21filter writes and lock bpf descriptor, ok henning@Can Erkin Acar
2004-04-21fix the error message in case the _dhcp user does not existHenning Brauer
2004-04-20don't allow the port to be changed here eitherHenning Brauer
2004-04-18various knf; henning okTheo de Raadt
2004-04-18dhcpd may be invoked without any interface givenHenning Brauer
2004-04-16a bunch of knf, ok henningTheo de Raadt
2004-04-15chroot and drop privileges after startupHenning Brauer