summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-05-23 18:06:33 +0200
committerLennart Poettering <lennart@poettering.net>2016-05-26 15:34:42 +0200
commitc9e458a419ae8961a27cea19d0a15b7058a132f9 (patch)
treef50f8e7a0bc47560b4d18baaf35adca3af07dc6c /src/libsystemd-network
parentd246e77a4343ff8a0266fc7dd5a7de5c524f9e44 (diff)
ipv4acd: introduce new "started" state
This state is active immediately after the state engine was started, but before the first timer hits. This way multiple _start() invocations on the same object are always detected correctly.
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r--src/libsystemd-network/sd-ipv4acd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-ipv4acd.c b/src/libsystemd-network/sd-ipv4acd.c
index 163d0f9199..59b87f42b7 100644
--- a/src/libsystemd-network/sd-ipv4acd.c
+++ b/src/libsystemd-network/sd-ipv4acd.c
@@ -57,6 +57,7 @@
typedef enum IPv4ACDState {
IPV4ACD_STATE_INIT,
+ IPV4ACD_STATE_STARTED,
IPV4ACD_STATE_WAITING_PROBE,
IPV4ACD_STATE_PROBING,
IPV4ACD_STATE_WAITING_ANNOUNCE,
@@ -240,7 +241,7 @@ static int ipv4acd_on_timeout(sd_event_source *s, uint64_t usec, void *userdata)
switch (ll->state) {
- case IPV4ACD_STATE_INIT:
+ case IPV4ACD_STATE_STARTED:
ipv4acd_set_state(ll, IPV4ACD_STATE_WAITING_PROBE, true);
if (ll->n_conflict >= MAX_CONFLICTS) {
@@ -521,6 +522,7 @@ int sd_ipv4acd_start(sd_ipv4acd *ll) {
if (r < 0)
goto fail;
+ ipv4acd_set_state(ll, IPV4ACD_STATE_STARTED, true);
return 0;
fail: