summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/test-dhcp6-client.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-07-24 18:53:01 +0200
committerTom Gundersen <teg@jklm.no>2014-07-24 19:02:58 +0200
commitfa94c34b083b5b4019975624453e53d0cbad2a5d (patch)
tree8bd0d0486f7b9f3b0c36e9075bc3999ec7b28c09 /src/libsystemd-network/test-dhcp6-client.c
parent77ff2de999b7ea6b1b4a3a218fbd9d62bb07cd54 (diff)
downloadsystemd-fa94c34b083b5b4019975624453e53d0cbad2a5d.tar.gz
systemd-fa94c34b083b5b4019975624453e53d0cbad2a5d.tar.bz2
systemd-fa94c34b083b5b4019975624453e53d0cbad2a5d.zip
libsystemd-network: use CLOCK_BOOTTIME instead of CLOCK_MONOTONIC where possible
The timeouts in the networking library (DHCP lease timeouts and similar) should not be affected by suspend. In the cases where CLOCK_BOOTTIME is not implemented, it is still safe to fallback to CLOCK_MONOTONIC, as the consumers of the library (i.e., networkd) _should_ renew the leases when coming out of suspend.
Diffstat (limited to 'src/libsystemd-network/test-dhcp6-client.c')
-rw-r--r--src/libsystemd-network/test-dhcp6-client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd-network/test-dhcp6-client.c b/src/libsystemd-network/test-dhcp6-client.c
index 5bb410dab3..96c68e1feb 100644
--- a/src/libsystemd-network/test-dhcp6-client.c
+++ b/src/libsystemd-network/test-dhcp6-client.c
@@ -537,7 +537,7 @@ static void test_client_solicit_cb(sd_dhcp6_client *client, int event,
static int test_client_solicit(sd_event *e) {
sd_dhcp6_client *client;
- usec_t time_now = now(CLOCK_MONOTONIC);
+ usec_t time_now = now(clock_boottime_or_monotonic());
if (verbose)
printf("* %s\n", __FUNCTION__);
@@ -553,7 +553,7 @@ static int test_client_solicit(sd_event *e) {
assert_se(sd_dhcp6_client_set_callback(client,
test_client_solicit_cb, e) >= 0);
- assert_se(sd_event_add_time(e, &hangcheck, CLOCK_MONOTONIC,
+ assert_se(sd_event_add_time(e, &hangcheck, clock_boottime_or_monotonic(),
time_now + 2 * USEC_PER_SEC, 0,
test_hangcheck, NULL) >= 0);