Fix rule attribute comparison

Rules don't have unique identifiers, so all attributes are compared
by initializing the ID mask to ~0. This doesn't work however since
nl_object_identical verifies whether the ID attributes are actually
present before comparing the objects, which is never the case.

Work around by using the intersection of present attributes when
comparing two rule objects.

Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
Patrick McHardy 2010-04-07 19:21:47 +02:00 committed by Thomas Graf
parent 0e4f54d288
commit 3c28aa5dca

View file

@ -265,6 +265,8 @@ int nl_object_identical(struct nl_object *a, struct nl_object *b)
return 0;
req_attrs = ops->oo_id_attrs;
if (req_attrs == ~0)
req_attrs = a->ce_mask & b->ce_mask;
/* Both objects must provide all required attributes to uniquely
* identify an object */