summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-12-18 10:23:40 +0000
committerRoy Marples <roy@marples.name>2008-12-18 10:23:40 +0000
commit8e06ab4a536e79752d8b6fa02910ccea4da0c8cd (patch)
treee9731c40ae7d3d55372f58b6d92f44443b44e34a /dhcpcd.c
parent02d339e3a6ecaf7869b4aa9bce5dce6a0ec44979 (diff)
downloaddhcpcd-8e06ab4a536e79752d8b6fa02910ccea4da0c8cd.tar.xz
Add the DHS_PROBE state so that we ignore subsequent offers
whilst probing.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index 92a92ba9..e691eb2c 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -502,14 +502,14 @@ handle_dhcp(struct interface *iface, struct dhcp_message **dhcpp)
state->claims = 0;
state->probes = 0;
state->conflicts = 0;
+ state->state = DHS_PROBE;
send_arp_probe(iface);
return;
}
}
/* We don't request BOOTP addresses */
if (type) {
- state->state = DHS_REQUEST;
- send_request(iface);
+ start_request(iface);
return;
}
}
@@ -697,6 +697,14 @@ start_discover(void *arg)
send_discover(iface);
}
+void
+start_request(void *arg)
+{
+ struct interface *iface = arg;
+
+ iface->state->state = DHS_REQUEST;
+ send_request(iface);
+}
void
start_renew(void *arg)
@@ -766,6 +774,7 @@ start_reboot(struct interface *iface)
} else if (ifo->options & DHCPCD_INFORM)
send_inform(iface);
else
+ /* We don't start_request as that would change state */
send_request(iface);
}