summary refs log tree commit diff
path: root/libnm-core/nm-setting-vlan.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2017-01-17 20:25:09 +0100
committerMichael Biebl <biebl@debian.org>2017-01-17 20:25:09 +0100
commit58f8be580039b0575b197b9573a1c92745d96d30 (patch)
tree2c226233f623a0dcb529be0eb8cdf97e4a2ae0c0 /libnm-core/nm-setting-vlan.c
parent45cb5bb3c0e6edb887cf69b417fcaf7053814a9b (diff)
New upstream version 1.5.90 upstream/1.5.90
Diffstat (limited to 'libnm-core/nm-setting-vlan.c')
-rw-r--r--libnm-core/nm-setting-vlan.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/libnm-core/nm-setting-vlan.c b/libnm-core/nm-setting-vlan.c
index 020f448c..61264784 100644
--- a/libnm-core/nm-setting-vlan.c
+++ b/libnm-core/nm-setting-vlan.c
@@ -147,13 +147,11 @@ priority_map_new_from_str (NMVlanPriorityMap map, const char *str)
 		to = g_ascii_strtoull (t[1], NULL, 10);
 
 		if ((from <= get_max_prio (map, TRUE)) && (to <= get_max_prio (map, FALSE))) {
-			p = g_malloc0 (sizeof (NMVlanQosMapping));
+			G_STATIC_ASSERT (sizeof (*p) == sizeof (p->from) + sizeof (p->to));
+			p = g_malloc (sizeof (NMVlanQosMapping));
 			p->from = from;
 			p->to = to;
 		}
-	} else {
-		/* Warn */
-		g_warn_if_fail (len == 2);
 	}
 
 	g_strfreev (t);
@@ -595,7 +593,7 @@ nm_setting_vlan_clear_priorities (NMSettingVlan *setting, NMVlanPriorityMap map)
 	set_map (setting, map, NULL);
 }
 
-/*********************************************************************/
+/*****************************************************************************/
 
 static void
 nm_setting_vlan_init (NMSettingVlan *setting)
@@ -639,7 +637,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
 					return FALSE;
 				}
 			}
-		} else if (!nm_utils_iface_valid_name (priv->parent)) {
+		} else if (!nm_utils_is_valid_iface_name (priv->parent, NULL)) {
 			/* parent must be either a UUID or an interface name */
 			g_set_error (error,
 			             NM_CONNECTION_ERROR,
@@ -747,13 +745,11 @@ set_property (GObject *object, guint prop_id,
 		break;
 	case PROP_INGRESS_PRIORITY_MAP:
 		g_slist_free_full (priv->ingress_priority_map, g_free);
-		priv->ingress_priority_map =
-			priority_strv_to_maplist (NM_VLAN_INGRESS_MAP, g_value_get_boxed (value));
+		priv->ingress_priority_map = priority_strv_to_maplist (NM_VLAN_INGRESS_MAP, g_value_get_boxed (value));
 		break;
 	case PROP_EGRESS_PRIORITY_MAP:
 		g_slist_free_full (priv->egress_priority_map, g_free);
-		priv->egress_priority_map =
-			priority_strv_to_maplist (NM_VLAN_EGRESS_MAP, g_value_get_boxed (value));
+		priv->egress_priority_map = priority_strv_to_maplist (NM_VLAN_EGRESS_MAP, g_value_get_boxed (value));
 		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);