summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd
AgeCommit message (Collapse)Author
2015-04-15Avoid using inet_ntoa() twice in a single printf() parameter listKenneth R Westerback
by caching the results from excess inet_ntoa() calls before doing the printf(). Should improve usefullness (?) of DHCPRELEASE log entries by actually printing ciaddr and giaddr correctly when dhcprelays stand between servers and clients. Looks good to dlg@.
2015-03-13remove the first comma from constructs like ", and," and ", or,": you can useJason McIntyre
"and" and "or" to join sentence clauses, and you can use commas, but both hinders reading;
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-02-05The pf table process should die if the pipe to the dhcpd process isKenneth R Westerback
closed. e.g. dhcpd has been killed. ok henning@
2015-01-21Include <netinet/in.h> before <net/pfvar.h>. In a future change whenTheo de Raadt
ports is ready, <net/pfvar.h> will stop including a pile of balony.
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-11-22/dev/random has created the same effect as /dev/arandom (and /dev/urandom)Theo de Raadt
for quite some time. Mop up the last few, by using /dev/random where we actually want it, or not even mentioning arandom where it is irrelevant.
2014-11-15Reduce instances of `` '' in manuals.Anthony J. Bentley
troff displays these as typographic quotes, but nroff implementations almost always print them literally, which rarely has the intended effect with modern fonts, even in stock xterm. These uses of `` '' can be replaced either with more semantic alternatives or with Dq, which prints typographic quotes in a UTF-8 locale (but will automatically fall back to `` '' in an ASCII locale). improvements and ok schwarze@
2014-11-11Tweak the the DHCPACK to DHCPINFORM log entry so that it isKenneth R Westerback
less threatening and more informative. e.g. DHCPACK on <null address> to 5c:51:4f:56:81:c3 via em0 changes to DHCPACK to 192.168.19.62 (3c:97:0e:0c:0c:d7) via em0 Issue noted and diff tested by Marc Peters. Thanks! ok yasuoka@ millert@
2014-11-10Typo: consitent -> consistent.Kenneth R Westerback
2014-10-25Remove unnecessary netinet/in_systm.h include.Lawrence Teo
ok millert@
2014-10-08use reallocarray() to cope with multiplicative integer overflow; ok dougTheo de Raadt
2014-08-18Variables to count seen packets should be unsigned.Tobias Stoeckmann
ok krw@
2014-08-11validate len field for proper length, not just "not zero."Tobias Stoeckmann
ok krw@
2014-07-28Fix memory exhaustion occurring on DHCP options with 0 length.Tobias Stoeckmann
halex@ and krw@ pointed out that a NULL check before free can go, too. ok deraadt@, halex@, krw@
2014-07-26Fix very hard to reach DoS attack vector, which would involve more thanTobias Stoeckmann
8 billion network packets. Mixture of many many malformed and proper packets could result in a division by zero. ok krw@
2014-07-11Fix DHCPINFORM not to lookup the lease database, not to fill the yiaddrYASUOKA Masahiko
field and not to include the lease time parameters. ok krw
2014-07-11tweak previous;Jason McIntyre
ok krw yasuoka
2014-07-11Fix typoYASUOKA Masahiko
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-07-09Fix classless-{ms-,}static-routes to comply RFC 3442. Number ofYASUOKA Masahiko
octets should be changed by corresponding to the prefix length. And 0 should be allowed for the prefix length. Also fix white spaces. Based on diff from Yuuichi Someya. ok krw
2014-06-11Prettify & refactor, no functional change.Martin Pelikan
ok beck
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
2014-02-08Create dhclient lease files and dhcpd lease files with permissions 0640,Kenneth R Westerback
rather than 0000 and 0664 respectively. ok kettenis@ tedu@
2014-01-21sort;Jason McIntyre
2014-01-21Add parsing for options 121 (classless-static-routes) and 249Kenneth R Westerback
(classless-ms-static-routes). dhcpd can now specify and serve these options and dhclient can recognize and use supersede, etc. statements on them. Based on a diff from Stefan Rinke. Thanks!
2014-01-03consistent Nd lines for the various dhcp bits; help/ok krwJason McIntyre
2013-12-18Two 'break;'s in a row seems excessive.Kenneth R Westerback
2013-12-05Stop pretending we still support FDDI or token ring hardware types.Kenneth R Westerback
idea ok deraadt@ matthew@
2013-12-05Nuke local #define ETHER_HEADER_SIZE and use the identical value'dKenneth R Westerback
ETHER_HDR_LEN from if_ether.h. dhclient change ok matthew@ as part of larger diff.
2013-11-22unsigned char cast for some ctype callsTheo de Raadt
ok krw
2013-10-21Use the provided netmask on the subnet value provided in 'subnet'Kenneth R Westerback
statements, allowing subsequent comparisions with interface addresses to always work properly. Problem noted, fix tested & ok dlg@
2013-10-19fix a few obvious .Ar markup errors (unfortunately, there are many more)Ingo Schwarze
found while working on mandoc apropos
2013-10-18Scattering a few bcopy()'s around source using mostly memcpy() is justKenneth R Westerback
asking for confusion. Replace bcopy()'s with memcpy()'s.
2013-10-18%d -> %lld, add (long long) cast to time_t variables. Make guentherKenneth R Westerback
and gcc happier. Found while looking at something else for dlg@.
2013-07-16use .Mt for email addresses; from Jan Stary <hans at stare dot cz>; ok jmc@Ingo Schwarze
2013-07-16simplify some icky macros; from Jan Stary, tweaked by meJason McIntyre
2013-07-15remove non-standard section: it does nothing for this page;Jason McIntyre
2013-07-14merge the relevant bits of dhcp(8) into dhclient(8) and dhcpd(8),Jason McIntyre
removing traces of dhcp(8)... i'm about to remove that file, since it's essentially useless. holding off for a little, in case my commit is greeted with howls. help/ok krw
2013-07-11update (or add) STANDARDS;Jason McIntyre
help/ok krw
2013-06-04Fix "\" escape handling in read_string().Kenneth R Westerback
Problem noted, fix tested and ok sthen@.
2013-05-16poll(2) might have slept for an arbitrary amount of time. We shouldGerhard Roth
update 'cur_time' after poll(2) returns. ok otto
2013-04-22When sync'ing, look for lease by hwaddr and then ipaddr. Not hwaddrKenneth R Westerback
twice. Simplify logic. Fixes loops while sync'ing for sthen@. Spotted by & fixed tested by sthen@.
2013-04-20Remove extraneous "\n" erroneously introduced by move to strftime().Kenneth R Westerback
Spotted by sthen@.
2013-04-19Log (at LOG_INFO) which interfaces dhcpd listens to and (as suggested byStuart Henderson
krw) their address. As dhcpd uses BPF, it's not possible to find this information out from fstat/netstat. ok krw@
2013-04-17Replace hand-rolled date printing/parsing code with strftime()/strptime().Kenneth R Westerback
Use timegm() because all the dates are in UTC and the 'standard' routines can't handle the truth. Remove some 'time_t is 32bits' assumptions. Print 'UTC' at the end of dates in the leases file, rather than mentioning that all dates are UTC in a comment at the top of the file. Feedback and suggestions from guenther@, kettenis@, otto@, tedu@, deraadt@.
2013-04-13Give struct dhcp_synctlv_lease fields a prefix (lv_) as the fieldsKenneth R Westerback
in other structs have. Reduces potential for confusion with fields of same name but different types in leases. Use consistent variable name. No change to executable.