summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libnm-core/nm-core-internal.h5
-rw-r--r--libnm-core/nm-setting-bridge.c4
-rw-r--r--src/devices/nm-device-bridge.c2
3 files changed, 7 insertions, 4 deletions
diff --git a/libnm-core/nm-core-internal.h b/libnm-core/nm-core-internal.h
index 8cea7e44c7..76ecd8f0e0 100644
--- a/libnm-core/nm-core-internal.h
+++ b/libnm-core/nm-core-internal.h
@@ -107,6 +107,10 @@
#define NM_BRIDGE_STP_DEF TRUE
+#define NM_BRIDGE_PRIORITY_MIN 0u
+#define NM_BRIDGE_PRIORITY_DEF 0x8000u
+#define NM_BRIDGE_PRIORITY_MAX ((guint) G_MAXUINT16)
+
#define BRIDGE_MULTICAST_LAST_MEMBER_COUNT_DEFAULT 2
#define BRIDGE_MULTICAST_LAST_MEMBER_INTERVAL_DEFAULT 100
#define BRIDGE_MULTICAST_MEMBERSHIP_INTERVAL_DEFAULT 26000
@@ -118,7 +122,6 @@
#define BRIDGE_MULTICAST_SNOOPING_DEFAULT TRUE
#define BRIDGE_MULTICAST_STARTUP_QUERY_COUNT_DEFAULT 2
#define BRIDGE_MULTICAST_STARTUP_QUERY_INTERVAL_DEFAULT 3125
-#define BRIDGE_PRIORITY_DEFAULT 0x8000
#define BRIDGE_VLAN_DEFAULT_PVID_DEFAULT 1
#define BRIDGE_VLAN_STATS_ENABLED_DEFAULT FALSE
diff --git a/libnm-core/nm-setting-bridge.c b/libnm-core/nm-setting-bridge.c
index ced8b5bdb7..c2a97e744a 100644
--- a/libnm-core/nm-setting-bridge.c
+++ b/libnm-core/nm-setting-bridge.c
@@ -1578,7 +1578,7 @@ nm_setting_bridge_init (NMSettingBridge *setting)
priv->multicast_membership_interval = BRIDGE_MULTICAST_MEMBERSHIP_INTERVAL_DEFAULT;
priv->multicast_hash_max = NM_BRIDGE_MULTICAST_HASH_MAX_DEF;
priv->multicast_snooping = BRIDGE_MULTICAST_SNOOPING_DEFAULT;
- priv->priority = BRIDGE_PRIORITY_DEFAULT;
+ priv->priority = NM_BRIDGE_PRIORITY_DEF;
priv->stp = NM_BRIDGE_STP_DEF;
priv->vlan_default_pvid = BRIDGE_VLAN_DEFAULT_PVID_DEFAULT;
priv->vlan_stats_enabled = BRIDGE_VLAN_STATS_ENABLED_DEFAULT;
@@ -1706,7 +1706,7 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
*/
obj_properties[PROP_PRIORITY] =
g_param_spec_uint (NM_SETTING_BRIDGE_PRIORITY, "", "",
- 0, G_MAXUINT16, BRIDGE_PRIORITY_DEFAULT,
+ NM_BRIDGE_PRIORITY_MIN, NM_BRIDGE_PRIORITY_MAX, NM_BRIDGE_PRIORITY_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 460faa65fa..f32bd66264 100644
--- a/src/devices/nm-device-bridge.c
+++ b/src/devices/nm-device-bridge.c
@@ -252,7 +252,7 @@ static const Option master_options[] = {
FALSE, FALSE, FALSE },
{ NM_SETTING_BRIDGE_PRIORITY, "priority",
NULL, NULL,
- 0, G_MAXUINT16, 0x8000,
+ NM_BRIDGE_PRIORITY_MIN, NM_BRIDGE_PRIORITY_MAX, NM_BRIDGE_PRIORITY_DEF,
TRUE, FALSE, TRUE },
{ NM_SETTING_BRIDGE_FORWARD_DELAY, "forward_delay",
NULL, NULL,