From e45b27a937a1439871be904f5ec0ff1fb7e3af7c Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Thu, 16 Feb 2023 13:25:17 +0100 Subject: [PATCH] platform: create a define for retry count when netlink drops data We're going to use it elsewhere. --- src/libnm-platform/nm-linux-platform.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libnm-platform/nm-linux-platform.c b/src/libnm-platform/nm-linux-platform.c index fe42a3b11..3845a2383 100644 --- a/src/libnm-platform/nm-linux-platform.c +++ b/src/libnm-platform/nm-linux-platform.c @@ -328,6 +328,10 @@ struct _ifla_vf_vlan_info { /*****************************************************************************/ +#define RESYNC_RETRIES 10 + +/*****************************************************************************/ + typedef struct { guint16 family_id; } GenlFamilyData; @@ -9850,7 +9854,8 @@ ip_route_get(NMPlatform *platform, /* Retry, if we failed due to a cache resync. That can happen when the netlink * socket fills up and we lost the response. */ - } while (seq_result == WAIT_FOR_NL_RESPONSE_RESULT_FAILED_RESYNC && ++try_count < 10); + } while (seq_result == WAIT_FOR_NL_RESPONSE_RESULT_FAILED_RESYNC + && ++try_count < RESYNC_RETRIES); if (seq_result < 0) { /* negative seq_result is an errno from kernel. Map it to negative