mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 05:50:06 +01:00
l3cfg: simplify the ACD timeouts
ACD_WAIT_PROBING_EXTRA_TIME_MSEC and ACD_WAIT_PROBING_EXTRA_TIME2_MSEC now are always used together. Consolidate them into a single constant.
This commit is contained in:
parent
127f73a5c2
commit
eb0a41ce1f
1 changed files with 5 additions and 8 deletions
|
|
@ -40,8 +40,7 @@ G_STATIC_ASSERT(NM_ACD_TIMEOUT_RFC5227_MSEC == N_ACD_TIMEOUT_RFC5227);
|
|||
|
||||
#define ACD_SUPPORTED_ETH_ALEN ETH_ALEN
|
||||
#define ACD_ENSURE_RATELIMIT_MSEC ((guint32) 4000u)
|
||||
#define ACD_WAIT_PROBING_EXTRA_TIME_MSEC ((guint32) (1000u + ACD_ENSURE_RATELIMIT_MSEC))
|
||||
#define ACD_WAIT_PROBING_EXTRA_TIME2_MSEC ((guint32) 1000u)
|
||||
#define ACD_WAIT_PROBING_EXTRA_TIME_MSEC ((guint32) (2000u + ACD_ENSURE_RATELIMIT_MSEC))
|
||||
#define ACD_WAIT_TIME_PROBING_FULL_RESTART_MSEC ((guint32) 30000u)
|
||||
#define ACD_WAIT_TIME_CONFLICT_RESTART_MSEC ((guint32) 120000u)
|
||||
#define ACD_WAIT_TIME_ANNOUNCE_RESTART_MSEC ((guint32) 30000u)
|
||||
|
|
@ -2322,8 +2321,7 @@ _l3_acd_data_timeout_schedule_probing_restart(AcdData *acd_data, gint64 now_msec
|
|||
nm_assert(acd_data->probing_timeout_msec > 0);
|
||||
nm_assert(acd_data->probing_timestamp_msec > 0);
|
||||
|
||||
expiry_msec = acd_data->probing_timestamp_msec + ACD_WAIT_PROBING_EXTRA_TIME_MSEC
|
||||
+ ACD_WAIT_PROBING_EXTRA_TIME2_MSEC;
|
||||
expiry_msec = acd_data->probing_timestamp_msec + ACD_WAIT_PROBING_EXTRA_TIME_MSEC;
|
||||
|
||||
timeout_msec = NM_MAX(0, expiry_msec - now_msec);
|
||||
|
||||
|
|
@ -2741,9 +2739,8 @@ handle_init:
|
|||
nm_utils_get_monotonic_timestamp_msec_cached(p_now_msec);
|
||||
|
||||
if (acd_data->info.state == NM_L3_ACD_ADDR_STATE_PROBING) {
|
||||
if ((*p_now_msec) > acd_data->probing_timestamp_msec
|
||||
+ ACD_WAIT_PROBING_EXTRA_TIME_MSEC
|
||||
+ ACD_WAIT_PROBING_EXTRA_TIME2_MSEC) {
|
||||
if ((*p_now_msec)
|
||||
> acd_data->probing_timestamp_msec + ACD_WAIT_PROBING_EXTRA_TIME_MSEC) {
|
||||
/* hm. We failed to create a new probe too long. Something is really wrong
|
||||
* internally, but let's ignore the issue and assume the address is good. What
|
||||
* else would we do? Assume the address is USED? */
|
||||
|
|
@ -2949,7 +2946,7 @@ handle_init:
|
|||
nm_utils_get_monotonic_timestamp_msec_cached(p_now_msec);
|
||||
|
||||
if (acd_data->probing_timestamp_msec + acd_data->probing_timeout_msec
|
||||
+ ACD_WAIT_PROBING_EXTRA_TIME_MSEC + ACD_WAIT_PROBING_EXTRA_TIME2_MSEC
|
||||
+ ACD_WAIT_PROBING_EXTRA_TIME_MSEC
|
||||
>= (*p_now_msec)) {
|
||||
/* The probing already started quite a while ago. We ignore the link event
|
||||
* and let the probe come to it's natural end. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue