summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd
AgeCommit message (Collapse)Author
2017-08-29do not claim that this is isc dhcpd (but retain credit);Jason McIntyre
issue pointed out by miod ok krw miod
2017-08-04Remove unused structs and defines, from Edgar Pettijohn. ok jca@rob
2017-07-31Removed unused struct, also noticed by Edgar Pettijohn. ok jca@, krw@rob
2017-07-11Handle DHCPINFORM from clients behind a DHCP relay.Reyk Floeter
The dhcpinform() function has assumed that ciaddr matches the packet's IP source address and didn't consider a relay, such as dhcrelay(8) - indicated by giaddr, has forwarded the request. Tested by landry@ OK krw@
2017-06-28remove a contradictory sentence (see dhcp-options(5)) which claimsJason McIntyre
hostnames which resolve to muliple ip addresses are all forwarded to the client; issue reported by edgar pettijohn; discussed with dhcpd's de facto maintainer, kenneth westerback;
2017-04-26remove some repetitive text chunks; ok krwJason McIntyre
2017-04-24a little more consistent text for previous; ok krwJason McIntyre
2017-04-24Add 'echo-client-id' statment, so that RFC 6842 behaviour can beKenneth R Westerback
turned off for those clients and networks that find it impossible to move past RFC 2131. Modelled on the same statement in recent ISC versions, though we default to 'on' (a.k.a. RFC 6842) rather that 'off' (a.k.a. RFC 2131). Problems reported by Bastien Durel (Xerox Phaser 6022 printer) and Bryan Vyhmeister (Hon Hai Precision router) via misc@. Thanks!
2017-04-19Switch base tools from /dev/bpf0 to /dev/bpf. Now that /dev/bpf has beenMartin Natano
around for two releases, it should be safe to do so. ok bluhm deraadt sthen tb yasuoka
2017-04-18Tweak parameters to decode_*, add a check or two, and thus gain most of theKenneth R Westerback
sanity improvements reyk@ recently put into dhcrelay to ensure no more than the captured packet is processed.
2017-04-18After 11 years of pondering about it I think that brookdavis@freebsd.orgKenneth R Westerback
had it correct. Don't BPF_WORDALIGN() the value for the number of bytes read() into the buffer. This could theoretically cause the processing of 1 - 3 more bytes than were read.
2017-04-17Use better types for checksum() parameters and local var fromKenneth R Westerback
dhclient. Eliminate extra prototypes for checksum() and wrapsum().
2017-04-13Remove a bunch of obsolete, unused and irrelevant DHCP client types, fields,Kenneth R Westerback
and enums.
2017-04-12Inspired by recent dhcrelay changes, bring in stricter CFLAGS!Kenneth R Westerback
2017-04-12One 'foo' per function is enough. Rename one to eliminate shadowing.Kenneth R Westerback
2017-04-12Add missing function prototypes. Mark kw_cmp() as static like allKenneth R Westerback
its friends.
2017-03-21From a syslog perspective it does not make sense to log fatal andAlexander Bluhm
warn with the same severity. Switch log_warn() to LOG_ERR and keep fatal() at LOG_CRIT. OK reyk@ florian@
2017-02-16Bring parse_warn() into the log.[ch] 21st century and adopt the "^"Kenneth R Westerback
placement logic from dhclient.
2017-02-15Adopt the common verbiage other log.[ch] daemons use to describe '-d'.Kenneth R Westerback
Point out that dhcpd(8) -f is an alias for -d.
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-13Do the strerror() elimination dance with log_warnx() -> log_warn(),Kenneth R Westerback
fatalx() -> fatal() and even a couple of fprintf(stderr) -> log_warn().
2017-02-13Banished to the attic.Kenneth R Westerback
2017-02-13Switch from old errwarn.c logging to shiny new log.[ch].Kenneth R Westerback
ok benno@
2017-02-11Move parse_warning() into parse.c to prepare to replace errwarn.cKenneth R Westerback
with standard daemon log.[ch]. ok mpi@
2017-02-04Appropriately replace "domain name" with "hostname"; less misleadingJeremie Courreges-Anglas
tb@ was initially concerned about next-server but there were more similar occurrences. Simple solution - "hostname" - proposed by jmc@ ok from both
2016-11-15Replace bzero(3) with memset(3)Ricardo Mestre
"Looks good" to deraadt@
2016-10-24Compare server-identifiers and reject packets only *after* applyingKenneth R Westerback
value specified in dhcpd.conf. i.e. don't assume it is always the primary address of the interface the packet arrived on. Fixes issues with redundant dhcpd servers and CARP'd interfaces. Issue reported and fix tested by Johan Huldtgren
2016-10-21- Use memset(*b, 0, len) instead of bzero(*b, len)Ricardo Mestre
- Use explicit_bzero(3) instead of bzero(3) to clean temporary HMAC OK krw@
2016-10-12client_identifier is not a string so using strlen() on it isKenneth R Westerback
inappropriate. Which is why client_identifier_len exists. Replace copy&pasted strlen() with client_identifier_len. Symptoms (crash) and cause (bad c&p) spotted by sthen@. tested & ok sthen@
2016-10-10Stop pretending we use RFC 3046/Option 82/Relay Agent Information.Kenneth R Westerback
RFC 3042 says servers that do not understand the option will not echo it. Plus, our desultory attempt at echoing was almost certainly broken for OFFERs (use after free of packet data) and not even attempted for NACKs. ok millert@
2016-10-06Add support for RFC 6842. RFC 2131 said the server MUST NOT echoKenneth R Westerback
the client-identifier value. RFC 6842 says the server MUST echo it. Echoing the information disambiguates packets for relays and clients when chaddr is 0. Similar to what dhcpv6 does.
2016-10-05Use consistant idiom (intermediate variable 'i' rather than repeatedKenneth R Westerback
uses of very long #define names) to access option data in nak_lease() and ack_lease(). Shortens a lot of lines, which allows a number of line splits to be eliminates. Makes some upcoming diffs easier to integrate. No intentional functional change.
2016-10-04Zap stray whitespace.Kenneth R Westerback
2016-08-27Pull in <time.h> for one or more of gmtime, strftime, strptime, time,Philip Guenther
timegm, and tzset ok deraadt@
2016-08-17KNF and clean up many comments.Kenneth R Westerback
2016-08-17Ansify function definitions.Kenneth R Westerback
Diff from Edgar Pettijohn.
2016-08-05Don't leak the option data of non-DHCPINFORM messages received onKenneth R Westerback
the udp socket. Found by David Carlier. ok yasuoka@
2016-05-28Replace the /dev/bpf* open loop with a plain open("/dev/bpf0", ...).Martin Natano
ok deraadt jca
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-04-04In udpsockmode codepath dhcpd.c had the promise route for pledge(2) but it wasRicardo Mestre
missing from udpsock_startup() (udpsock.c) which happens earlier and therefore would abort the program due to SIOCGIFADDR ioctl(2) on udpsock_handler Reported by Philip Higgins <phil ! unita.com.au> OK tb@
2016-02-08sys/param.h -> sys/types.h. No need to drag in nitems() only toKenneth R Westerback
use it once on an array declared iov[1]. Just use '1'. ok yasuoka@
2016-02-07avoid a use after free when parsing address ranges from a configJonathan Gray
ok krw@
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@.
2016-02-03be very careful accepting packets via bpf. First check that theKenneth R Westerback
fixed part of the IP header is completely present before using its header length field. Then use the data in the IP header to ensure the entire IP packet is present. Then check that the entire UDP header is present. Then use the data in the UDP header to ensure all the data it thinks is present is actually present. Started when tj@ and a few others noticed ISC "DHCP CVE-2015-8605: UDP payload length not properly checked". ok sthen@ henning@
2015-12-21remove NULL-checks before free()mmcc
2015-12-14pledge.Kenneth R Westerback
Diff from Ricardo Mestre. Test report from sthen@.
2015-12-11Actually use default-lease-time, max-lease-time, bootp-lease-lengthKenneth R Westerback
specified in dhcpd.conf. Broken in -r1.18. Problem noted by Arne on bugs@, identical fix independently developed by Serguey Parkhomovsky.
2015-09-14Avoid .Ns right after .Pf, it's pointless.Ingo Schwarze
In some cases, do additional cleanup in the immediate vicinity.
2015-08-20stdlib.h is in scope; do not cast malloc/calloc/realloc*Theo de Raadt
ok millert krw