diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2020-01-29 10:33:14 +0100 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2020-01-29 10:33:14 +0100 |
| commit | c1b3616485604f3fddfad9521cb8818cd8eece2b (patch) | |
| tree | e5ed317b0d86dcae783a9caf45415ba8be6d2ad1 /shared | |
| parent | a524db35ac5c2099671d16318524e277e88631be (diff) | |
| parent | 90c93214efba0966274224a93a77d235d4f8c034 (diff) | |
Merge branch 'upstream/latest' of https://salsa.debian.org/utopia-team/network-manager into upstream/latest
Diffstat (limited to 'shared')
| -rw-r--r-- | shared/n-dhcp4/src/n-dhcp4-c-connection.c | 3 | ||||
| -rw-r--r-- | shared/n-dhcp4/src/n-dhcp4-c-probe.c | 10 | ||||
| -rw-r--r-- | shared/n-dhcp4/src/n-dhcp4-private.h | 1 | ||||
| -rw-r--r-- | shared/nm-version-macros.h | 2 |
4 files changed, 11 insertions, 5 deletions
diff --git a/shared/n-dhcp4/src/n-dhcp4-c-connection.c b/shared/n-dhcp4/src/n-dhcp4-c-connection.c index e51a3e32..f3ae44e2 100644 --- a/shared/n-dhcp4/src/n-dhcp4-c-connection.c +++ b/shared/n-dhcp4/src/n-dhcp4-c-connection.c @@ -139,6 +139,9 @@ int n_dhcp4_c_connection_listen(NDhcp4CConnection *connection) { _c_cleanup_(c_closep) int fd_packet = -1; int r; + if (connection->state == N_DHCP4_C_CONNECTION_STATE_PACKET) + return 0; + c_assert(connection->state == N_DHCP4_C_CONNECTION_STATE_INIT || connection->state == N_DHCP4_C_CONNECTION_STATE_DRAINING || connection->state == N_DHCP4_C_CONNECTION_STATE_UDP); diff --git a/shared/n-dhcp4/src/n-dhcp4-c-probe.c b/shared/n-dhcp4/src/n-dhcp4-c-probe.c index 4fb7d389..5bed15b8 100644 --- a/shared/n-dhcp4/src/n-dhcp4-c-probe.c +++ b/shared/n-dhcp4/src/n-dhcp4-c-probe.c @@ -946,7 +946,7 @@ static int n_dhcp4_client_probe_transition_ack(NDhcp4ClientProbe *probe, NDhcp4I n_dhcp4_client_lease_unref(probe->current_lease); probe->current_lease = n_dhcp4_client_lease_ref(lease); probe->state = N_DHCP4_CLIENT_PROBE_STATE_BOUND; - + probe->ns_nak_restart_delay = 0; break; case N_DHCP4_CLIENT_PROBE_STATE_REQUESTING: @@ -969,7 +969,7 @@ static int n_dhcp4_client_probe_transition_ack(NDhcp4ClientProbe *probe, NDhcp4I node->event.granted.lease = n_dhcp4_client_lease_ref(lease); probe->current_lease = n_dhcp4_client_lease_ref(lease); probe->state = N_DHCP4_CLIENT_PROBE_STATE_GRANTED; - + probe->ns_nak_restart_delay = 0; break; case N_DHCP4_CLIENT_PROBE_STATE_INIT: @@ -1004,9 +1004,11 @@ static int n_dhcp4_client_probe_transition_nak(NDhcp4ClientProbe *probe) { return r; probe->state = N_DHCP4_CLIENT_PROBE_STATE_INIT; - + probe->ns_deferred = n_dhcp4_gettime(CLOCK_BOOTTIME) + probe->ns_nak_restart_delay; + probe->ns_nak_restart_delay = C_CLAMP(probe->ns_nak_restart_delay * 2, + UINT64_C(1000000000 * 2), + UINT64_C(1000000000 * 300)); break; - case N_DHCP4_CLIENT_PROBE_STATE_SELECTING: case N_DHCP4_CLIENT_PROBE_STATE_INIT_REBOOT: case N_DHCP4_CLIENT_PROBE_STATE_INIT: diff --git a/shared/n-dhcp4/src/n-dhcp4-private.h b/shared/n-dhcp4/src/n-dhcp4-private.h index fcfb0f35..c092ae8f 100644 --- a/shared/n-dhcp4/src/n-dhcp4-private.h +++ b/shared/n-dhcp4/src/n-dhcp4-private.h @@ -352,6 +352,7 @@ struct NDhcp4ClientProbe { unsigned int state; /* current probe state */ uint64_t ns_deferred; /* timeout for deferred action */ uint64_t ns_reinit; + uint64_t ns_nak_restart_delay; /* restart delay after a nak */ NDhcp4ClientLease *current_lease; /* current lease */ NDhcp4CConnection connection; /* client connection wrapper */ diff --git a/shared/nm-version-macros.h b/shared/nm-version-macros.h index c79a0e13..b8c5fbb9 100644 --- a/shared/nm-version-macros.h +++ b/shared/nm-version-macros.h @@ -30,7 +30,7 @@ * Evaluates to the micro version number of NetworkManager which this source * compiled against. */ -#define NM_MICRO_VERSION (2) +#define NM_MICRO_VERSION (4) /** * NM_CHECK_VERSION: |