summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-dhcp6-client.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-08-28 15:46:29 +0200
committerTom Gundersen <teg@jklm.no>2014-08-28 21:19:17 +0200
commit9021bb9f935c93b516b10c88db2a212a9e3a8140 (patch)
tree812f2077c86db0d38da59649b03d0728ddd363a0 /src/libsystemd-network/sd-dhcp6-client.c
parent752bbf75b9b52c0faae29bb4b77a99c4bb0d298f (diff)
sd-event: name event sources used in libraries
This should help in debugging failing event sources.
Diffstat (limited to 'src/libsystemd-network/sd-dhcp6-client.c')
-rw-r--r--src/libsystemd-network/sd-dhcp6-client.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
index f69c0ed8a6..342a231413 100644
--- a/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/libsystemd-network/sd-dhcp6-client.c
@@ -496,6 +496,11 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec,
if (r < 0)
goto error;
+ r = sd_event_source_set_name(client->timeout_resend,
+ "dhcp6-resend-timer");
+ if (r < 0)
+ goto error;
+
if (max_retransmit_duration && !client->timeout_resend_expire) {
log_dhcp6_client(client, "Max retransmission duration %"PRIu64" secs",
@@ -514,6 +519,11 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec,
client->event_priority);
if (r < 0)
goto error;
+
+ r = sd_event_source_set_name(client->timeout_resend_expire,
+ "dhcp6-resend-expire-timer");
+ if (r < 0)
+ goto error;
}
error:
@@ -894,6 +904,11 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state)
if (r < 0)
return r;
+ r = sd_event_source_set_name(client->receive_message,
+ "dhcp6-receive-message");
+ if (r < 0)
+ return r;
+
client->state = DHCP6_STATE_SOLICITATION;
break;
@@ -942,6 +957,11 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state)
if (r < 0)
return r;
+ r = sd_event_source_set_name(client->lease->ia.timeout_t1,
+ "dhcp6-t1-timeout");
+ if (r < 0)
+ return r;
+
timeout = client_timeout_compute_random(be32toh(client->lease->ia.lifetime_t2) * USEC_PER_SEC);
log_dhcp6_client(client, "T2 expires in %s",
@@ -962,6 +982,11 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state)
if (r < 0)
return r;
+ r = sd_event_source_set_name(client->lease->ia.timeout_t2,
+ "dhcp6-t2-timeout");
+ if (r < 0)
+ return r;
+
client->state = state;
return 0;
@@ -980,6 +1005,11 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state)
if (r < 0)
return r;
+ r = sd_event_source_set_name(client->timeout_resend,
+ "dhcp6-resend-timeout");
+ if (r < 0)
+ return r;
+
return 0;
}