summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd
AgeCommit message (Collapse)Author
2019-10-03Properly initalize the ICMP message to zero to avoid leaking 4-byteClaudio Jeker
of uninitialised memory in the sent icmp echorequest. Reported by Adarsh Dinesh (adarsh.dinesh at gmail com) OK florian@ deraadt@
2019-08-08One missing piece when I added pledge(2) to dhcpd(8) was in the code path whenRicardo Mestre
it's invoked with either -A/-C/-L, which at the time I left alone due to some forbidden ioctls by pledge(2). Now we have unveil(2) and this path can be further restricted by using it instead of chroot(2) since this "sandbox" (not sure why people call sandbox to about everything these days) can be escaped with *at(2) calls. Since no filesystem access is needed here then we can disable its access by calling unveil("/", "") unveil(NULL, NULL). added /* no filesystem visibility */ as per suggestion by and OK deraadt@
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@
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-05-10Fix dhcpd build on gcc architectures.Visa Hankala
OK deraadt@ jca@
2019-05-08Switch domain-search parsing from hand rolled hex string toKenneth R Westerback
human readable list of strings. Slightly tweaked version of a diff from William Ahern via tech@. Long silence on all fronts leads to community based testing.
2019-04-02Document new domain-search syntax available toKenneth R Westerback
dhclient(8).
2019-04-01missing full stop;Jason McIntyre
2019-04-01Add a rfc1035 data type and use it to describeKenneth R Westerback
domain-search. Mention that dhcpd(8) still calls this option-119. Also mention that the information provided by this option will be used in preference to domain-name when constructing resolv.conf(5). Merciless prodding by florian@ and kn@.
2019-04-01Describe the cidr data type and rework theKenneth R Westerback
classless[-ms]-static-routes verbiage to use cidr and ip-address types rather than hand waving manual construction. Add an explicit note that dhclient(8) ignores the obsolete "static-routes" option.
2019-04-01int16 and int8 are not used for any option. So don'tKenneth R Westerback
mention them.
2019-04-01Document dhcp-message (a.k.a. option 56) and tweak verbiage forKenneth R Westerback
dhcp-max-message-size (a.k.a. option 57) in the hope of clarifying things.
2019-04-01Correct the documentation of relay-agent-information,Kenneth R Westerback
nds-context and nds-tree-name to show that they are parsed as data-string ('X') and not string ('t'). Correct the documentation of dhcp-option-overload to show that it is parsed as a single uint8, not an array of uint8s.
2019-03-18explicitly use BPF_FILDROP_CAPTURE when configuring BIOCSFILDROPDavid Gwynne
BIOCSFILDROP used to just be a flag, ie, any non-zero value was treated the same, but i'm changing it so different values do different things. this way the programs should keep working even if i decide to change the values for these macros.
2018-12-07I noticed the "pf table handler" process not going away on dhcpd restart,Henning Brauer
looked at the error handling here, and.... oh my. If opening /dev/pf on startup fails, don't just warn and move on, but bail. If chroot (or the chdir after) fail, don't just warn and move on, bail. If dropping privileges fails, the last thing we want to do is to just move on with root privs, having warned or not. If the pipe to the parent process is closed, that almost certainly means that the parent process went away, and it absolutely certainly means that the table handler process has no meaningful reason to exist any more, thus bail. ok florian ccardenas krw
2018-07-03Tighten up description of echo-client-id statementKenneth R Westerback
to make it clearer. Explicitly mention that older printers may require it to be set to false, as this has come up on the mailing lists a few times. Original diff from sthen@. ok jmc@
2018-03-01consistently spell "IPsec"; from raf czlonkaJason McIntyre
note that this is only part of raf's original diff: the rest is for code. although i'm sure the diff itself is correct, i don;t judge myself qualified to decide whether those changes are warranted. still, i'd appreciate at least a reply to raf's diff from another developer (yay! nay!)
2018-02-28Better documentation of the classless-static-routes option.Matthieu Herrb
ok krw@, tweaks by jmc@
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.