summary refs log tree commit diff
path: root/libnm-core/nm-setting-vxlan.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-04-11 21:28:04 +0200
committerMichael Biebl <biebl@debian.org>2020-04-11 21:28:04 +0200
commit1e5977b62f896e844b548c3007ace9e1dfa7f9ed (patch)
tree7a7416ed410e72b6200f3d860fd315ec11cc106b /libnm-core/nm-setting-vxlan.c
parentb012fa6e1d808e0736c009799c62d835cbfcc1dd (diff)
New upstream version 1.23.90 upstream/1.23.90
Diffstat (limited to 'libnm-core/nm-setting-vxlan.c')
-rw-r--r--libnm-core/nm-setting-vxlan.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/libnm-core/nm-setting-vxlan.c b/libnm-core/nm-setting-vxlan.c
index 4e449bc8..edde1ad5 100644
--- a/libnm-core/nm-setting-vxlan.c
+++ b/libnm-core/nm-setting-vxlan.c
@@ -45,9 +45,9 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
 
 typedef struct {
 	char *parent;
-	guint id;
 	char *local;
 	char *remote;
+	guint id;
 	guint source_port_min;
 	guint source_port_max;
 	guint destination_port;
@@ -55,11 +55,11 @@ typedef struct {
 	guint ttl;
 	guint ageing;
 	guint limit;
-	gboolean learning;
-	gboolean proxy;
-	gboolean rsc;
-	gboolean l2_miss;
-	gboolean l3_miss;
+	bool learning:1;
+	bool proxy:1;
+	bool rsc:1;
+	bool l2_miss:1;
+	bool l3_miss:1;
 } NMSettingVxlanPrivate;
 
 G_DEFINE_TYPE (NMSettingVxlan, nm_setting_vxlan, NM_TYPE_SETTING)
@@ -327,9 +327,9 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
 		return FALSE;
 	}
 
-	if (nm_utils_ipaddr_valid (AF_INET, priv->remote))
+	if (nm_utils_ipaddr_is_valid (AF_INET, priv->remote))
 		family = AF_INET;
-	else if (nm_utils_ipaddr_valid (AF_INET6, priv->remote))
+	else if (nm_utils_ipaddr_is_valid (AF_INET6, priv->remote))
 		family = AF_INET6;
 	else {
 		g_set_error (error,
@@ -344,7 +344,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
 	}
 
 	if (priv->local) {
-		if (!nm_utils_ipaddr_valid (family, priv->local)) {
+		if (!nm_utils_ipaddr_is_valid (family, priv->local)) {
 			g_set_error (error,
 			             NM_CONNECTION_ERROR,
 			             NM_CONNECTION_ERROR_INVALID_PROPERTY,
@@ -519,8 +519,13 @@ set_property (GObject *object, guint prop_id,
 /*****************************************************************************/
 
 static void
-nm_setting_vxlan_init (NMSettingVxlan *setting)
+nm_setting_vxlan_init (NMSettingVxlan *self)
 {
+	NMSettingVxlanPrivate *priv = NM_SETTING_VXLAN_GET_PRIVATE (self);
+
+	priv->destination_port = DST_PORT_DEFAULT;
+	priv->ageing           = 300;
+	priv->learning         = TRUE;
 }
 
 /**
@@ -576,7 +581,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_string (NM_SETTING_VXLAN_PARENT, "", "",
 	                         NULL,
 	                         G_PARAM_READWRITE |
-	                         G_PARAM_CONSTRUCT |
 	                         NM_SETTING_PARAM_INFERRABLE |
 	                         G_PARAM_STATIC_STRINGS);
 	/**
@@ -591,7 +595,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_uint (NM_SETTING_VXLAN_ID, "", "",
 	                       0, (1 << 24) - 1, 0,
 	                       G_PARAM_READWRITE |
-	                       G_PARAM_CONSTRUCT |
 	                       NM_SETTING_PARAM_INFERRABLE |
 	                       G_PARAM_STATIC_STRINGS);
 
@@ -606,7 +609,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_string (NM_SETTING_VXLAN_LOCAL, "", "",
 	                         NULL,
 	                         G_PARAM_READWRITE |
-	                         G_PARAM_CONSTRUCT |
 	                         NM_SETTING_PARAM_INFERRABLE |
 	                         G_PARAM_STATIC_STRINGS);
 
@@ -623,7 +625,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_string (NM_SETTING_VXLAN_REMOTE, "", "",
 	                         NULL,
 	                         G_PARAM_READWRITE |
-	                         G_PARAM_CONSTRUCT |
 	                         NM_SETTING_PARAM_INFERRABLE |
 	                         G_PARAM_STATIC_STRINGS);
 
@@ -639,7 +640,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_uint (NM_SETTING_VXLAN_SOURCE_PORT_MIN, "", "",
 	                       0, G_MAXUINT16, 0,
 	                       G_PARAM_READWRITE |
-	                       G_PARAM_CONSTRUCT |
 	                       NM_SETTING_PARAM_INFERRABLE |
 	                       G_PARAM_STATIC_STRINGS);
 
@@ -655,7 +655,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_uint (NM_SETTING_VXLAN_SOURCE_PORT_MAX, "", "",
 	                       0, G_MAXUINT16, 0,
 	                       G_PARAM_READWRITE |
-	                       G_PARAM_CONSTRUCT |
 	                       NM_SETTING_PARAM_INFERRABLE |
 	                       G_PARAM_STATIC_STRINGS);
 
@@ -671,7 +670,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_uint (NM_SETTING_VXLAN_DESTINATION_PORT, "", "",
 	                       0, G_MAXUINT16, DST_PORT_DEFAULT,
 	                       G_PARAM_READWRITE |
-	                       G_PARAM_CONSTRUCT |
 	                       NM_SETTING_PARAM_INFERRABLE |
 	                       G_PARAM_STATIC_STRINGS);
 
@@ -686,7 +684,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_uint (NM_SETTING_VXLAN_AGEING, "", "",
 	                       0, G_MAXUINT32, 300,
 	                       G_PARAM_READWRITE |
-	                       G_PARAM_CONSTRUCT |
 	                       NM_SETTING_PARAM_INFERRABLE |
 	                       G_PARAM_STATIC_STRINGS);
 
@@ -702,7 +699,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_uint (NM_SETTING_VXLAN_LIMIT, "", "",
 	                       0, G_MAXUINT32, 0,
 	                       G_PARAM_READWRITE |
-	                       G_PARAM_CONSTRUCT |
 	                       NM_SETTING_PARAM_INFERRABLE |
 	                       G_PARAM_STATIC_STRINGS);
 
@@ -717,7 +713,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_uint (NM_SETTING_VXLAN_TOS, "", "",
 	                       0, 255, 0,
 	                       G_PARAM_READWRITE |
-	                       G_PARAM_CONSTRUCT |
 	                       NM_SETTING_PARAM_INFERRABLE |
 	                       G_PARAM_STATIC_STRINGS);
 
@@ -732,7 +727,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_uint (NM_SETTING_VXLAN_TTL, "", "",
 	                       0, 255, 0,
 	                       G_PARAM_READWRITE |
-	                       G_PARAM_CONSTRUCT |
 	                       NM_SETTING_PARAM_INFERRABLE |
 	                       G_PARAM_STATIC_STRINGS);
 
@@ -747,7 +741,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_boolean (NM_SETTING_VXLAN_PROXY, "", "",
 	                          FALSE,
 	                          G_PARAM_READWRITE |
-	                          G_PARAM_CONSTRUCT |
 	                          NM_SETTING_PARAM_INFERRABLE |
 	                          G_PARAM_STATIC_STRINGS);
 
@@ -763,7 +756,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_boolean (NM_SETTING_VXLAN_LEARNING, "", "",
 	                          TRUE,
 	                          G_PARAM_READWRITE |
-	                          G_PARAM_CONSTRUCT |
 	                          NM_SETTING_PARAM_INFERRABLE |
 	                          G_PARAM_STATIC_STRINGS);
 	/**
@@ -777,7 +769,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_boolean (NM_SETTING_VXLAN_RSC, "", "",
 	                          FALSE,
 	                          G_PARAM_READWRITE |
-	                          G_PARAM_CONSTRUCT |
 	                          NM_SETTING_PARAM_INFERRABLE |
 	                          G_PARAM_STATIC_STRINGS);
 	/**
@@ -791,7 +782,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_boolean (NM_SETTING_VXLAN_L2_MISS, "", "",
 	                          FALSE,
 	                          G_PARAM_READWRITE |
-	                          G_PARAM_CONSTRUCT |
 	                          NM_SETTING_PARAM_INFERRABLE |
 	                          G_PARAM_STATIC_STRINGS);
 
@@ -806,7 +796,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
 	    g_param_spec_boolean (NM_SETTING_VXLAN_L3_MISS, "", "",
 	                          FALSE,
 	                          G_PARAM_READWRITE |
-	                          G_PARAM_CONSTRUCT |
 	                          NM_SETTING_PARAM_INFERRABLE |
 	                          G_PARAM_STATIC_STRINGS);