From 3c28aa5dca309286ad9136c6d4742969b5dfde1d Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Wed, 7 Apr 2010 19:21:47 +0200 Subject: 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 --- lib/object.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/object.c b/lib/object.c index 46d8141..d881ac9 100644 --- a/lib/object.c +++ b/lib/object.c @@ -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 */ -- cgit v1.2.3