Commit 355cbbfb authored by Thomas Haller's avatar Thomas Haller

core: assert for valid NM_DEVICE_DEVICE_TYPE setting

(cherry picked from commit 7dd44d6d)
parent 4251f4e4
......@@ -16344,6 +16344,8 @@ set_property (GObject *object, guint prop_id,
/* construct-only */
nm_assert (priv->type == NM_DEVICE_TYPE_UNKNOWN);
priv->type = g_value_get_uint (value);
nm_assert (priv->type > NM_DEVICE_TYPE_UNKNOWN);
nm_assert (priv->type <= NM_DEVICE_TYPE_WIFI_P2P);
break;
case PROP_LINK_TYPE:
/* construct-only */
......
......@@ -75,6 +75,7 @@ nm_test_device_new (const char *hwaddr)
return g_object_new (NM_TYPE_TEST_DEVICE,
NM_DEVICE_IFACE, "dummy",
NM_DEVICE_PERM_HW_ADDRESS, hwaddr,
NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_ETHERNET,
NULL);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment