mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 19:20:12 +01:00
core: assert for valid NM_DEVICE_DEVICE_TYPE setting
(cherry picked from commit 7dd44d6dc8)
This commit is contained in:
parent
4251f4e476
commit
355cbbfb5c
2 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue