X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibsystemd-network%2Fsd-ipv4ll.c;h=8626d4afa993a32df288c8ced0ac91e3b582dab4;hb=820aced6f6067a6b7c57b7d36e44f64378870cbf;hp=fd39c12eb22df0c028fc1721001627e9a67ea697;hpb=d9bf4f8c6c47b8620ffa1a056208eb15118b78d5;p=elogind.git diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c index fd39c12eb..8626d4afa 100644 --- a/src/libsystemd-network/sd-ipv4ll.c +++ b/src/libsystemd-network/sd-ipv4ll.c @@ -186,8 +186,8 @@ static void ipv4ll_set_next_wakeup(sd_ipv4ll *ll, int sec, int random_sec) { if (random_sec) next_timeout += random_u32() % (random_sec * USEC_PER_SEC); - if (sd_event_now(ll->event, CLOCK_MONOTONIC, &time_now) < 0) - time_now = now(CLOCK_MONOTONIC); + if (sd_event_now(ll->event, clock_boottime_or_monotonic(), &time_now) < 0) + time_now = now(clock_boottime_or_monotonic()); ll->next_wakeup = time_now + next_timeout; ll->next_wakeup_valid = 1; @@ -289,7 +289,7 @@ static void ipv4ll_run_state_machine(sd_ipv4ll *ll, IPv4LLTrigger trigger, void if (ipv4ll_arp_conflict(ll, in_packet)) { - r = sd_event_now(ll->event, CLOCK_MONOTONIC, &time_now); + r = sd_event_now(ll->event, clock_boottime_or_monotonic(), &time_now); if (r < 0) goto out; @@ -344,7 +344,7 @@ static void ipv4ll_run_state_machine(sd_ipv4ll *ll, IPv4LLTrigger trigger, void if (ll->next_wakeup_valid) { ll->timer = sd_event_source_unref(ll->timer); - r = sd_event_add_time(ll->event, &ll->timer, CLOCK_MONOTONIC, + r = sd_event_add_time(ll->event, &ll->timer, clock_boottime_or_monotonic(), ll->next_wakeup, 0, ipv4ll_timer, ll); if (r < 0) goto out; @@ -352,6 +352,10 @@ static void ipv4ll_run_state_machine(sd_ipv4ll *ll, IPv4LLTrigger trigger, void r = sd_event_source_set_priority(ll->timer, ll->event_priority); if (r < 0) goto out; + + r = sd_event_source_set_description(ll->timer, "ipv4ll-timer"); + if (r < 0) + goto out; } out: @@ -560,17 +564,24 @@ int sd_ipv4ll_start (sd_ipv4ll *ll) { if (r < 0) goto out; + r = sd_event_source_set_description(ll->receive_message, "ipv4ll-receive-message"); + if (r < 0) + goto out; + r = sd_event_add_time(ll->event, &ll->timer, - CLOCK_MONOTONIC, - now(CLOCK_MONOTONIC), 0, + clock_boottime_or_monotonic(), + now(clock_boottime_or_monotonic()), 0, ipv4ll_timer, ll); if (r < 0) goto out; r = sd_event_source_set_priority(ll->timer, ll->event_priority); + if (r < 0) + goto out; + r = sd_event_source_set_description(ll->timer, "ipv4ll-timer"); out: if (r < 0) ipv4ll_stop(ll, IPV4LL_EVENT_STOP);