freebsd-dev/sbin/dhclient
David Bright 3acf1760b7 dhclient violates RFC2131 when sending early DHCPREQUEST message to re-obtain old IP
When dhclient first starts, if an old IP address exists in the
dhclient.leases file, dhclient(8) sends early DHCPREQUEST message(s)
in an attempt to re-obtain the old IP address again. These messages
contain the old IP as a requested-IP-address option in the message
body (correct) but also use the old IP address as the packet's source
IP (incorrect).

RFC2131 sec 4.1 states:

  DHCP messages broadcast by a client prior to that client obtaining
  its IP address must have the source address field in the IP header
  set to 0.

The use of the old IP as the packet's source address is incorrect if
(a) the computer is now on a different network or (b) it is on the
same network, but the old IP has been reallocated to another host.

Fix dhclient to use 0.0.0.0 as the source IP in this circumstance
without removing any existing functionality. Any previously-used old
IP is still requested in the body of an early DHCPREQUEST message.

PR:		199378
Submitted by:	J.R. Oldroyd <fbsd@opal.com>
Reported by:	J.R. Oldroyd <fbsd@opal.com>
Reviewed by:	cem, asomers, vangyzen
MFC after:	1 week
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D14527
2018-02-27 21:59:23 +00:00
..
tests dhclient: raise WARNS to 4 2018-02-21 21:13:08 +00:00
alloc.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
bpf.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
clparse.c dhclient: raise WARNS to 4 2018-02-21 21:13:08 +00:00
conflex.c dhclient: raise WARNS to 4 2018-02-21 21:13:08 +00:00
convert.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
dhclient-script
dhclient-script.8 use .Mt to mark up email addresses consistently (part1) 2014-06-20 09:40:43 +00:00
dhclient.8 use .Mt to mark up email addresses consistently (part1) 2014-06-20 09:40:43 +00:00
dhclient.c dhclient violates RFC2131 when sending early DHCPREQUEST message to re-obtain old IP 2018-02-27 21:59:23 +00:00
dhclient.conf
dhclient.conf.5 mdoc: improvements to SEE ALSO. 2014-12-27 08:22:58 +00:00
dhclient.leases.5 mdoc: improvements to SEE ALSO. 2014-12-27 08:22:58 +00:00
dhcp-options.5 use .Mt to mark up email addresses consistently (part1) 2014-06-20 09:40:43 +00:00
dhcp.h General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
dhcpd.h dhclient: raise WARNS to 4 2018-02-21 21:13:08 +00:00
dhctoken.h General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
dispatch.c dhclient: raise WARNS to 4 2018-02-21 21:13:08 +00:00
errwarn.c dhclient: raise WARNS to 4 2018-02-21 21:13:08 +00:00
hash.c dhclient: raise WARNS to 4 2018-02-21 21:13:08 +00:00
inet.c dhclient(8): raise WARNS to 3 2017-12-14 15:41:32 +00:00
Makefile dhclient: raise WARNS to 4 2018-02-21 21:13:08 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
options.c dhclient: raise WARNS to 4 2018-02-21 21:13:08 +00:00
packet.c dhclient(8): raise WARNS to 3 2017-12-14 15:41:32 +00:00
parse.c dhclient(8): add missing include 2018-01-12 04:26:40 +00:00
privsep.c dhclient: raise WARNS to 4 2018-02-21 21:13:08 +00:00
privsep.h dhclient: raise WARNS to 4 2018-02-21 21:13:08 +00:00
tables.c dhclient: raise WARNS to 4 2018-02-21 21:13:08 +00:00
tree.c dhclient(8): raise WARNS to 3 2017-12-14 15:41:32 +00:00
tree.h dhclient: raise WARNS to 4 2018-02-21 21:13:08 +00:00