commit bdd1d09c1149e230e91157347fe86517c74f5084 Author: Patrick McHardy Date: Tue Apr 6 18:47:46 2010 +0200 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 diff --git a/lib/object.c b/lib/object.c index 310757b..5c8cb2a 100644 --- a/lib/object.c +++ b/lib/object.c @@ -266,6 +266,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 */