summaryrefslogtreecommitdiff
path: root/sbin/dhclient
AgeCommit message (Collapse)Author
2017-02-15Use new log.[ch] functions in parse_warn().Kenneth R Westerback
Simplify the "^" placing logic and make it apply to log entries as well as terminal output. Since dhclient(8) can be re-exec'd for various reasons after going daemon, make sure we don't try to log to stderr if it isn't a TTY.
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-14fatalx() prepends 'fatal in _progname:'. So eliminate redundantKenneth R Westerback
'; exiting' suffix used by old style logging. Eliminate an extra log message before fatal()'ing out with a summary message.
2017-02-12Eliminate most strerror() invocations by using log_warn() and fatal()Kenneth R Westerback
instead of log_warnx() and fatalx(). A few log_info() to log_warn() for the same reason. Suggested by millert@.
2017-02-12Adjust lines that are too long.Kenneth R Westerback
2017-02-12Remove now unused file.Kenneth R Westerback
2017-02-12Switch from 'legacy' errwarn.c to standard daemon logging functions.Kenneth R Westerback
No objections heard. Feedback from millert@ guenther@
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-02grammar fix; from tinkerJason McIntyre
2017-01-23Keep socket open from startup, and reuse for SIOCGIFFLAGS later on,Theo de Raadt
rather than opening a fresh socket on the fly. ok krw
2016-11-25Nuke the DHO_ROUTERS and DHO_STATIC_ROUTES options from the effectiveKenneth R Westerback
lease when DHO_CLASSLESS_[MS_]STATIC_ROUTES are present. RFC 3442 says the client must ignore the former if the latter is present. The information was already ignored but was still written to the 'effective' section of the pseudo-lease file created by the -L option. This incorrectly implied that these options were 'effective'. Problem noted by Ed Fochler. Thanks!
2016-10-06Add support for RFC 6842, which says the client MUST drop packets whenKenneth R Westerback
the server provides a client-identifier value and it doesn't match the value the client sent. So stop suppressing client-identifer info in the leases file and when reading the leases file stop discarding leases that don't have current client-identifier info. Don't use them, but keep them around in case the client-identifier info changes back next time. Also construct the default client-identifier (if needed) before reading the leases file.
2016-09-30Zap stray whitespace.Kenneth R Westerback
2016-09-29Don't record non-existant client identifier in lease file.Kenneth R Westerback
2016-09-29'ifname' --> 'ifi->name' so DEBUG compiles again.Kenneth R Westerback
2016-09-27Reintroduce rdaemon() - working properly this timeJeremie Courreges-Anglas
Thanks Ken for fixing my initial implementation. ok krw@
2016-09-16Revert use of rdaemon() until it doesn't break install/upgrade.Kenneth R Westerback
Problem cause deduced by kili@, reproduced by & ok rpe@.
2016-09-15Use rdaemon() in dhclient too.Jeremie Courreges-Anglas
dhclient already has code to pre-open /dev/null, in order to properly go to the background after chroot(2). Use rdaemon() like in tftpd, ftp-proxy, dhcrelay and rtadvd. No objection krw@, ok dlg@
2016-09-04Use 'daemonize' instead of 'no_daemon', just like in dhcpd and dhcrelay.Jeremie Courreges-Anglas
ok krw@
2016-09-02Kill 'ifi' global.Martin Pieuchot
ok henning@, krw@
2016-09-02Treat backoff_cutoff as a hard cutoff, not the midpoint in a rangeKenneth R Westerback
from .5 to 1.5 ofthe value. This is how the man page describes it and nobody can remember why it was not being used as a hard limit. ok benno@
2016-09-01tweak previous;Jason McIntyre
2016-09-01Document new default timeouts/intervals.Kenneth R Westerback
2016-09-01Cut back the default values for the various timeout/interval values. We noKenneth R Westerback
longer live in a 10Mb/sec shared media world with 1Mhz Vaxen DHCP servers. ok benno@ otto@ phessler@
2016-09-01Informative comments describing the various timing fields (initial_interval,Kenneth R Westerback
reboot_timeout, etc.) when setting them to their defaults.
2016-08-31REQUEST packets are not just sent when an interface reboots. So don't shortKenneth R Westerback
circuit the waiting for ACK's by giving up after reboot_timeout. ok tedu@
2016-08-31Use reboot_timeout (default: 1) instead of initial_interval (default: 3) whenKenneth R Westerback
the interface reboots. Thus the fallback from REQUEST to DISCOVER will take place after the intended reboot_timeout seconds. ok tedu@ mpi@
2016-08-31Remove the 'client' global and make it per-ifp.Martin Pieuchot
ok krw@
2016-08-23Make the 'ifi' global local to dhclient.c and pass it as an argument toMartin Pieuchot
functions needing it. This is the first step to support multiple interfaces in one dhclient(8) instance. ok krw@
2016-08-16Track SSID in leases file and only consider leases from the current SSID whenKenneth R Westerback
starting up dhclient on wifi interfaces. In theory will preserve leases from other SSID's and speed up obtaining a lease by not wasting time attempting to re-acquire a lease from a different SSID. Experimental feature from n2k16 needing some real world testing before g2k16.
2016-07-31Ask for DHO_BOOTFILE_NAME and DHO_TFTP_SERVER by default. May proveKenneth R Westerback
useful to autoinstall in the future and in the meantime can provide information on what the dhcp server has done with the desired server name and file name info. Original diff from Patrik Lundin via tech@
2016-07-23Back out the dhclient BPF change. There are DHCP servers out there whichStefan Sperling
send frames to the ethernet broadcast address, so this will need some more thought and it's too late for 6.0. Problem reported by Holger Mikolon. ok mpi@
2016-07-22Actually DECLINE and delete unused offers. Don't just say so in a comment.Kenneth R Westerback
In situations where >1 offer is received this will eliminate unbounded memory growth and make us a more polite netizen. In some corner cases it might prevent reuse of inappropriate older offers. ok millert@
2016-07-21Use explicit idiom when testing the result of strcmp() and strncmp().Kenneth R Westerback
i.e. == 0 and != 0 as appropriate. No intentional functional change. Suggested by & ok tom@
2016-07-20Shrink priv_write_file() API so that it does less, and the callers askTheo de Raadt
it to do less. Discussion with guenther. ok krw
2016-07-20As a general rule, fchown before fchmod is a safer order (because manyTheo de Raadt
systems throw away bits upon chown). Not in this case, but code gets copied.. ok krw
2016-07-19Narrow the BPF read filter rules so only packets sent to theKenneth R Westerback
interface's LLADDR pass. Rely on dhclient's existing ability to detect and react to LLADDR changes. This limits the number of packets that get dropped as a result of dhclient setting BIOCSFILDROP on the bpf descriptor. Problem with bridges and multiple dhclients noted by stsp@. ok mpi@ stsp@ deraadt@ henning@
2016-06-03update default value for rebootTed Unangst
2016-06-03The networks I use are sufficiently fast that a 10 second "reboot" timeoutTed Unangst
is not necessary, and in fact quite annoying when I swtich networks and want to get back to the init state quickly. Default instead to 1 second. The very few users who encounter problems may edit dhclient.conf. ok benno krw does not object
2016-05-08Use /dev/bpf0 instead of /dev/bpf (without loop though), as suggested byMartin Natano
sthen@. to make remote upgrades without media less painful. ok tb@
2016-05-03Move to /dev/bpf; ok tb jmcMartin Natano
2016-04-28If the attempt to broadcast a DCHPDISCOVER packet returns EAFNOSUPPORT,Kenneth R Westerback
don't bother to keep trying to get a lease. It ain't gonna happen. Just print and error message and exit.
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@
2016-01-26Use an unsigned int rather than an int when iterating through all 32mmcc
bits in the form: for (i = 1; i; i <<= 1) This avoids undefined operations when shifting into and out of the highest-order bit. ok millert@
2015-12-19Don't exit if a route can't be added. Just log particulars andKenneth R Westerback
let someone else figure it out. ok mpi@
2015-12-19Delete superfluous "continue;" just before end of loop.Kenneth R Westerback
2015-12-19Delete superfluous "close(s);return" just before "close(s);<functionKenneth R Westerback
exit>".
2015-12-18Check ioctl() result with == -1, not < 0. Break long line.Kenneth R Westerback
2015-12-12Send DECLINE messages in response to ACK messages that turn out toKenneth R Westerback
have inadequate or invalid leases. In particular leases for addresses that are already configured on a different interface. After the DECLINE, return to INIT state and start looking for a valid lease. This conforms much closer to the relevant RFC's. Avoids 'hanging' dhclient(8) during boot when the attempt to configure the address fails without dhclient(8) realizing it. Issue found and various fixes tested by mpi@. Feedback from beck@ and reyk@. ok mpi@