diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-10-12 11:50:34 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-10-12 19:49:49 +0200 |
commit | 7502812c926dfa4ced3dcbb0fd4dbc5468799b91 (patch) | |
tree | c94f5e2ea1f8ead9835884aa636dc74bb0cc14d5 /src/libsystemd-network/sd-dhcp6-client.c | |
parent | sd-dhcp6-client: introduce dhcp6_option_can_request() (diff) | |
download | systemd-7502812c926dfa4ced3dcbb0fd4dbc5468799b91.tar.xz systemd-7502812c926dfa4ced3dcbb0fd4dbc5468799b91.zip |
sd-dhcp6-client: max_retransmit_time must be positive
Found by LGTM.com analysis.
Diffstat (limited to '')
-rw-r--r-- | src/libsystemd-network/sd-dhcp6-client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index cb05bd216e..aacdf06980 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -1067,8 +1067,8 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, void *userda client->retransmit_time += init_retransmit_time / 10; } else { - if (max_retransmit_time > 0 && - client->retransmit_time > max_retransmit_time / 2) + assert(max_retransmit_time > 0); + if (client->retransmit_time > max_retransmit_time / 2) client->retransmit_time = client_timeout_compute_random(max_retransmit_time); else client->retransmit_time += client_timeout_compute_random(client->retransmit_time); |