summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-05-18 16:40:28 +0000
committerRoy Marples <roy@marples.name>2016-05-18 16:40:28 +0000
commita5c054c9d5f81b6918c37c0b49cf5af548c26921 (patch)
tree78d2219b77ccf2ab7f96f2654799c84bae180086
parented73c962b164dd270b4359588ea3824e4873b776 (diff)
downloaddhcpcd-a5c054c9d5f81b6918c37c0b49cf5af548c26921.tar.xz
Fix requesting a lease witout an existing address.
-rw-r--r--dhcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dhcp.c b/dhcp.c
index 32d2f907..878ddff1 100644
--- a/dhcp.c
+++ b/dhcp.c
@@ -831,8 +831,8 @@ make_message(struct bootp **bootpm, const struct interface *ifp, uint8_t type)
if (lease->addr.s_addr && lease->cookie == htonl(MAGIC_COOKIE)) {
if (type == DHCP_DECLINE ||
(type == DHCP_REQUEST &&
- state->addr != NULL &&
- lease->addr.s_addr != state->addr->addr.s_addr))
+ (state->addr == NULL ||
+ lease->addr.s_addr != state->addr->addr.s_addr)))
{
PUT_ADDR(DHO_IPADDRESS, &lease->addr);
if (lease->server.s_addr)