summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authordab <dab@FreeBSD.org>2018-03-09 14:38:46 +0000
committerdab <dab@FreeBSD.org>2018-03-09 14:38:46 +0000
commitf15266a5e831a2e9cccc0724d388daa78010df76 (patch)
tree888c9eae667541e88ab70785b687b058bee3361d /sbin
parent2b6c410852dbbb8633f1f10f80cca3df4d810d0e (diff)
downloadFreeBSD-src-f15266a5e831a2e9cccc0724d388daa78010df76.zip
FreeBSD-src-f15266a5e831a2e9cccc0724d388daa78010df76.tar.gz
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
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/dhclient.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index c56b553..6e04224 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1478,7 +1478,8 @@ cancel:
memcpy(&to.s_addr, ip->client->destination.iabuf,
sizeof(to.s_addr));
- if (ip->client->state != S_REQUESTING)
+ if (ip->client->state != S_REQUESTING &&
+ ip->client->state != S_REBOOTING)
memcpy(&from, ip->client->active->address.iabuf,
sizeof(from));
else
OpenPOWER on IntegriCloud