mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 13:50:15 +01:00
platform: fix nmp_object_copy(id_only) for object that don't implement cmd_plobj_id_copy()
The if-else-if was wrong. It meant that if an object did not implement
cmd_plobj_id_copy(), nothign was copied (for id-only).
I think this code path was not actually hit, because we never clone
an object only by ID.
Fixes: c91a4617a1 ('nmp-object: allow missing implementations for certain virtual functions')
This commit is contained in:
parent
a275285537
commit
ee34eeafb9
1 changed files with 3 additions and 4 deletions
|
|
@ -1317,10 +1317,9 @@ nmp_object_copy(NMPObject *dst, const NMPObject *src, gboolean id_only)
|
|||
|
||||
g_return_if_fail(klass == NMP_OBJECT_GET_CLASS(src));
|
||||
|
||||
if (id_only) {
|
||||
if (klass->cmd_plobj_id_copy)
|
||||
klass->cmd_plobj_id_copy(&dst->object, &src->object);
|
||||
} else if (klass->cmd_obj_copy)
|
||||
if (id_only && klass->cmd_plobj_id_copy)
|
||||
klass->cmd_plobj_id_copy(&dst->object, &src->object);
|
||||
else if (klass->cmd_obj_copy)
|
||||
klass->cmd_obj_copy(dst, src);
|
||||
else
|
||||
memcpy(&dst->object, &src->object, klass->sizeof_data);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue