mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 18:08:05 +02:00
lldp: fix lldp_neighbor_equal() to compare lists of variants
Fixes:6c52d946fc('lldp: add support for management address TLV') (cherry picked from commit7c0d73d94a) (cherry picked from commit0426681ab4) (cherry picked from commit321f9b51c3) (cherry picked from commit2e9d7c84d6)
This commit is contained in:
parent
2dd77af678
commit
ecfc48eca5
1 changed files with 13 additions and 0 deletions
|
|
@ -400,6 +400,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