diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-02-06 18:48:03 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-02-14 06:51:19 +0100 |
commit | 0f3b8b809ce83c09eb6c3915c98df4afa2146cfa (patch) | |
tree | 5ece2968d1a2df1b928ee16e8b30366412e006e4 /src | |
parent | sd-dhcp6-client: set lease expiration timer in client_enter_bound_state() (diff) | |
download | systemd-0f3b8b809ce83c09eb6c3915c98df4afa2146cfa.tar.xz systemd-0f3b8b809ce83c09eb6c3915c98df4afa2146cfa.zip |
sd-dhcp6-client: drop unnecessary event_source_disable()
The event source will be soon re-enabled in the same function.
The function client_timeout_resend() may return earlier without
re-enabling the timer souce. However,
- the timer event source is one shot by default. Hence, it is not
necessary to disable in the callback function,
- when it returns early, then client_set_state() or client_stop() is
called before return, and they re-ernable or disable the timer.
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd-network/sd-dhcp6-client.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 0ebe9f503b..95ec78d828 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -951,8 +951,6 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, void *userda assert(s); assert(client->event); - (void) event_source_disable(client->timeout_resend); - switch (client->state) { case DHCP6_STATE_INFORMATION_REQUEST: init_retransmit_time = DHCP6_INF_TIMEOUT; @@ -1342,7 +1340,6 @@ static int client_set_state(sd_dhcp6_client *client, DHCP6State state) { assert_not_reached(); } - (void) event_source_disable(client->timeout_resend); client->retransmit_time = 0; client->retransmit_count = 0; |