freebsd-src/sbin/dhclient
David Bright 3f63e58efb MFC r330085:
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>
Sponsored by:   Dell EMC
2018-03-09 14:39:28 +00:00
..
tests MFC r315199,r315200,r315203: 2017-03-20 03:06:41 +00:00
alloc.c Add __FBSDID to all .c files in dhclient to aid in determining file 2005-08-23 23:59:55 +00:00
bpf.c Merge an applicable subset of r263234 from HEAD to stable/10: 2015-03-19 12:32:48 +00:00
clparse.c MFC r315199,r315200,r315203: 2017-03-20 03:06:41 +00:00
conflex.c MFC r301235: 2016-06-06 13:31:28 +00:00
convert.c Add __FBSDID to all .c files in dhclient to aid in determining file 2005-08-23 23:59:55 +00:00
dhclient-script Set svn:executable on dhclient-script 2011-12-30 14:46:53 +00:00
dhclient-script.8 MFC r267667: 2016-10-16 22:02:50 +00:00
dhclient.8 MFC r267667: 2016-10-16 22:02:50 +00:00
dhclient.c MFC r330085: 2018-03-09 14:39:28 +00:00
dhclient.conf Implement RFC3442, the Classless Static Route option. 2007-02-09 17:50:26 +00:00
dhclient.conf.5 MFC r267667: 2016-10-16 22:02:50 +00:00
dhclient.leases.5 MFC r267667: 2016-10-16 22:02:50 +00:00
dhcp-options.5 MFC r267667: 2016-10-16 22:02:50 +00:00
dhcp.h Support domain-search in dhclient(8) 2011-12-04 14:44:31 +00:00
dhcpd.h MFp4 @229481: 2013-07-03 22:12:54 +00:00
dhctoken.h Import the OpenBSD dhclient as shipped with OpenBSD-3.7 (the tag 2005-06-07 04:05:09 +00:00
dispatch.c MFC r311160, r311210, r311288, r311292, r311298, r311340 2017-02-02 19:50:28 +00:00
errwarn.c Make dhclient use a pid file. Modify the rc script accordingly; while 2011-10-13 17:20:45 +00:00
hash.c Add __FBSDID to all .c files in dhclient to aid in determining file 2005-08-23 23:59:55 +00:00
inet.c Add __FBSDID to all .c files in dhclient to aid in determining file 2005-08-23 23:59:55 +00:00
Makefile MFC various moves of tools/regressions/ tests to the new infrastructure. 2014-04-27 01:15:10 +00:00
options.c Spelling fixes for sbin/ 2012-01-07 16:09:33 +00:00
packet.c MFp4 @229471: 2013-07-03 21:49:10 +00:00
parse.c In sbin/dhclient, since we know the size of the source strings anyway, 2011-12-17 01:29:46 +00:00
privsep.c MFp4 @229481: 2013-07-03 22:12:54 +00:00
privsep.h MFp4 @229479: 2013-07-03 22:07:55 +00:00
tables.c Support domain-search in dhclient(8) 2011-12-04 14:44:31 +00:00
tree.c Add __FBSDID to all .c files in dhclient to aid in determining file 2005-08-23 23:59:55 +00:00
tree.h Import the OpenBSD dhclient as shipped with OpenBSD-3.7 (the tag 2005-06-07 04:05:09 +00:00