mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 04:18:07 +02:00
lldp: fix lldp_neighbor_equal() to compare lists of variants
Fixes: 6c52d946fc ('lldp: add support for management address TLV')
This commit is contained in:
parent
8cd9b87c91
commit
7c0d73d94a
1 changed files with 13 additions and 0 deletions
|
|
@ -388,6 +388,19 @@ lldp_neighbor_equal (LldpNeighbor *a, LldpNeighbor *b)
|
||||||
if (!nm_streq (a->attrs[attr_id].v_string, b->attrs[attr_id].v_string))
|
if (!nm_streq (a->attrs[attr_id].v_string, b->attrs[attr_id].v_string))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
|
case LLDP_ATTR_TYPE_ARRAY_OF_VARDICTS: {
|
||||||
|
NMCListElem *itr_a, *itr_b;
|
||||||
|
|
||||||
|
if (c_list_length (&a->attrs[attr_id].v_variant_list) != c_list_length (&b->attrs[attr_id].v_variant_list))
|
||||||
|
return FALSE;
|
||||||
|
itr_b = c_list_first_entry (&b->attrs[attr_id].v_variant_list, NMCListElem, lst);
|
||||||
|
c_list_for_each_entry (itr_a, &a->attrs[attr_id].v_variant_list, lst) {
|
||||||
|
if (!g_variant_equal (itr_a->data, itr_b->data))
|
||||||
|
return FALSE;
|
||||||
|
itr_b = c_list_entry (&itr_b->lst, NMCListElem, lst);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
nm_assert (a->attrs[attr_id].attr_type == LLDP_ATTR_TYPE_NONE);
|
nm_assert (a->attrs[attr_id].attr_type == LLDP_ATTR_TYPE_NONE);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue