X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibsystemd-network%2Fsd-ipv4ll.c;fp=src%2Flibsystemd-network%2Fsd-ipv4ll.c;h=a201139b08eabbd404f055b187c4f5e322ddcac8;hb=6a0f1f6d5af7c7300d3db7a0ba2b068f8abd222b;hp=7431af729e6cbcc999f3d52f62121197d0e01a25;hpb=f66eeb6bb636f8061bf45e6e8e24761e87510800;p=elogind.git diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c index 7431af729..a201139b0 100644 --- a/src/libsystemd-network/sd-ipv4ll.c +++ b/src/libsystemd-network/sd-ipv4ll.c @@ -165,7 +165,7 @@ static int ipv4ll_timer(sd_event_source *s, uint64_t usec, void *userdata) { return 0; } -static void ipv4ll_set_next_wakeup (sd_ipv4ll *ll, int sec, int random_sec) { +static void ipv4ll_set_next_wakeup(sd_ipv4ll *ll, int sec, int random_sec) { usec_t next_timeout = 0; usec_t time_now = 0; @@ -178,7 +178,7 @@ 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_get_now_monotonic(ll->event, &time_now) < 0) + if (sd_event_now(ll->event, CLOCK_MONOTONIC, &time_now) < 0) time_now = now(CLOCK_MONOTONIC); ll->next_wakeup = time_now + next_timeout; @@ -278,7 +278,7 @@ static void ipv4ll_run_state_machine(sd_ipv4ll *ll, IPv4LLTrigger trigger, void if (ipv4ll_arp_conflict(ll, in_packet)) { - r = sd_event_get_now_monotonic(ll->event, &time_now); + r = sd_event_now(ll->event, CLOCK_MONOTONIC, &time_now); if (r < 0) goto out; @@ -330,8 +330,8 @@ 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_monotonic(ll->event, &ll->timer, - ll->next_wakeup, 0, ipv4ll_timer, ll); + r = sd_event_add_time(ll->event, &ll->timer, CLOCK_MONOTONIC, + ll->next_wakeup, 0, ipv4ll_timer, ll); if (r < 0) goto out; @@ -530,8 +530,11 @@ int sd_ipv4ll_start (sd_ipv4ll *ll) { if (r < 0) goto out; - r = sd_event_add_monotonic(ll->event, &ll->timer, now(CLOCK_MONOTONIC), 0, - ipv4ll_timer, ll); + r = sd_event_add_time(ll->event, + &ll->timer, + CLOCK_MONOTONIC, + now(CLOCK_MONOTONIC), 0, + ipv4ll_timer, ll); if (r < 0) goto out;