Verified Commit 0426681a authored by Thomas Haller's avatar Thomas Haller

lldp: fix lldp_neighbor_equal() to compare lists of variants

Fixes: 6c52d946 ('lldp: add support for management address TLV')
(cherry picked from commit 7c0d73d9)
parent 94f8e9fb
......@@ -387,6 +387,19 @@ lldp_neighbor_equal (LldpNeighbor *a, LldpNeighbor *b)
if (!nm_streq (a->attrs[attr_id].v_string, b->attrs[attr_id].v_string))
return FALSE;
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:
nm_assert (a->attrs[attr_id].attr_type == LLDP_ATTR_TYPE_NONE);
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment