mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 05:40:15 +01:00
systemd: fix crash by unrefing event sources before re-adding them
In certain cases the timeouts may not have been unref'ed before they need to be re-added. Add the appropriate unref calls to ensure we don't register the timeout multiple times. This fixes possible cases where timeouts are triggered multiple times and even on destroyed DHCPv6 clients. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/73 (cherry picked from commite179202e47) (cherry picked from commitbbef6cf44a) (cherry picked from commitd535f95b6b)
This commit is contained in:
parent
b9c70ec0c5
commit
fe5949dcff
1 changed files with 2 additions and 0 deletions
|
|
@ -1100,6 +1100,7 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state) {
|
|||
log_dhcp6_client(client, "T1 expires in %s",
|
||||
format_timespan(time_string, FORMAT_TIMESPAN_MAX, timeout, USEC_PER_SEC));
|
||||
|
||||
client->lease->ia.timeout_t1 = sd_event_source_unref(client->lease->ia.timeout_t1);
|
||||
r = sd_event_add_time(client->event,
|
||||
&client->lease->ia.timeout_t1,
|
||||
clock_boottime_or_monotonic(), time_now + timeout,
|
||||
|
|
@ -1122,6 +1123,7 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state) {
|
|||
log_dhcp6_client(client, "T2 expires in %s",
|
||||
format_timespan(time_string, FORMAT_TIMESPAN_MAX, timeout, USEC_PER_SEC));
|
||||
|
||||
client->lease->ia.timeout_t2 = sd_event_source_unref(client->lease->ia.timeout_t2);
|
||||
r = sd_event_add_time(client->event,
|
||||
&client->lease->ia.timeout_t2,
|
||||
clock_boottime_or_monotonic(), time_now + timeout,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue