mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 02:10:09 +01:00
platform: fix nmp_object_hash() to include object type
NMPlatformLnkMacvtap is a typedef of NMPlatformLnkMacvlan, hence, their plobj implementation is idential. nmp_object_equal() already correctly compares the object type, so we should hash it too.
This commit is contained in:
parent
bb009630a1
commit
d2f856fb95
1 changed files with 7 additions and 10 deletions
|
|
@ -860,6 +860,7 @@ guint
|
|||
nmp_object_hash (const NMPObject *obj)
|
||||
{
|
||||
const NMPClass *klass;
|
||||
guint h;
|
||||
|
||||
if (!obj)
|
||||
return 0;
|
||||
|
|
@ -869,16 +870,12 @@ nmp_object_hash (const NMPObject *obj)
|
|||
klass = NMP_OBJECT_GET_CLASS (obj);
|
||||
|
||||
if (klass->cmd_obj_hash)
|
||||
return klass->cmd_obj_hash (obj);
|
||||
if (klass->cmd_plobj_hash)
|
||||
return klass->cmd_plobj_hash (&obj->object);
|
||||
return GPOINTER_TO_UINT (obj);
|
||||
}
|
||||
|
||||
static guint
|
||||
_vt_cmd_obj_hash_not_implemented (const NMPObject *obj)
|
||||
{
|
||||
g_return_val_if_reached (0);
|
||||
h = klass->cmd_obj_hash (obj);
|
||||
else if (klass->cmd_plobj_hash)
|
||||
h = klass->cmd_plobj_hash (&obj->object);
|
||||
else
|
||||
return GPOINTER_TO_UINT (obj);
|
||||
return NM_HASH_COMBINE (h, klass->obj_type);
|
||||
}
|
||||
|
||||
static guint
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue