From f61e354cfa00de200fd69d3eb5c14ae812b84e9a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 5 May 2020 10:49:58 +0200 Subject: [PATCH] libnm: adjust bridge defines NM_BRIDGE_AGEING_TIME_* --- libnm-core/nm-core-internal.h | 6 +++--- libnm-core/nm-setting-bridge.c | 8 ++++---- src/devices/nm-device-bridge.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libnm-core/nm-core-internal.h b/libnm-core/nm-core-internal.h index 01321eb976..815510360a 100644 --- a/libnm-core/nm-core-internal.h +++ b/libnm-core/nm-core-internal.h @@ -88,8 +88,9 @@ #define NM_BR_MAX_MAX_AGE 40 /* IEEE 802.1D-1998 Table 7.4 */ -#define NM_BR_MIN_AGEING_TIME 0 -#define NM_BR_MAX_AGEING_TIME 1000000 +#define NM_BRIDGE_AGEING_TIME_MIN 0u +#define NM_BRIDGE_AGEING_TIME_DEF 300u +#define NM_BRIDGE_AGEING_TIME_MAX 1000000u #define NM_BR_PORT_MAX_PRIORITY 63 #define NM_BR_PORT_DEF_PRIORITY 32 @@ -101,7 +102,6 @@ #define NM_BRIDGE_MULTICAST_HASH_MAX_DEF 4096u #define NM_BRIDGE_MULTICAST_HASH_MAX_MAX ((guint) G_MAXUINT32) -#define BRIDGE_AGEING_TIME_DEFAULT 300 #define BRIDGE_FORWARD_DELAY_DEFAULT 15 #define BRIDGE_HELLO_TIME_DEFAULT 2 #define BRIDGE_MAX_AGE_DEFAULT 20 diff --git a/libnm-core/nm-setting-bridge.c b/libnm-core/nm-setting-bridge.c index c725376a1d..7898369ebd 100644 --- a/libnm-core/nm-setting-bridge.c +++ b/libnm-core/nm-setting-bridge.c @@ -1224,8 +1224,8 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) return FALSE; if (!check_range (priv->ageing_time, - NM_BR_MIN_AGEING_TIME, - NM_BR_MAX_AGEING_TIME, + NM_BRIDGE_AGEING_TIME_MIN, + NM_BRIDGE_AGEING_TIME_MAX, !priv->stp, NM_SETTING_BRIDGE_AGEING_TIME, error)) @@ -1569,7 +1569,7 @@ nm_setting_bridge_init (NMSettingBridge *setting) priv->vlans = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_bridge_vlan_unref); - priv->ageing_time = BRIDGE_AGEING_TIME_DEFAULT; + priv->ageing_time = NM_BRIDGE_AGEING_TIME_DEF; priv->forward_delay = BRIDGE_FORWARD_DELAY_DEFAULT; priv->hello_time = BRIDGE_HELLO_TIME_DEFAULT; priv->max_age = BRIDGE_MAX_AGE_DEFAULT; @@ -1786,7 +1786,7 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass) */ obj_properties[PROP_AGEING_TIME] = g_param_spec_uint (NM_SETTING_BRIDGE_AGEING_TIME, "", "", - NM_BR_MIN_AGEING_TIME, NM_BR_MAX_AGEING_TIME, BRIDGE_AGEING_TIME_DEFAULT, + NM_BRIDGE_AGEING_TIME_MIN, NM_BRIDGE_AGEING_TIME_MAX, NM_BRIDGE_AGEING_TIME_DEF, G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS); diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c index 487cd28f82..1f71aa8395 100644 --- a/src/devices/nm-device-bridge.c +++ b/src/devices/nm-device-bridge.c @@ -268,7 +268,7 @@ static const Option master_options[] = { TRUE, TRUE, TRUE }, { NM_SETTING_BRIDGE_AGEING_TIME, "ageing_time", NULL, NULL, - NM_BR_MIN_AGEING_TIME, NM_BR_MAX_AGEING_TIME, 300, + NM_BRIDGE_AGEING_TIME_MIN, NM_BRIDGE_AGEING_TIME_MAX, NM_BRIDGE_AGEING_TIME_DEF, TRUE, TRUE, FALSE }, { NM_SETTING_BRIDGE_GROUP_FORWARD_MASK, "group_fwd_mask", NULL, NULL,