[PATCH] Default to comparing all attributes if no oo_id_attrs defined

Andrew Collins bsderandrew at gmail.com
Mon Jun 17 17:24:05 EDT 2013


Since commit: "cache pickup: Avoid duplicates during cache pickup",
nfnl_ct_alloc_cache no longer properly fills the cache, as it doesn't
define oo_id_attrs so all items are considered duplicates.

Instead of adding a ~0 oo_id_attrs to ct_obj, this changes
nl_object_identical to default to comparing all attributes if
neither oo_id_attrs_get or oo_id_attrs are provided.
---
 lib/object.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/object.c b/lib/object.c
index b1ebe51..9293df9 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -321,8 +321,10 @@ int nl_object_identical(struct nl_object *a, struct nl_object *b)
 		if (req_attrs_a != req_attrs_b)
 			return 0;
 		req_attrs = req_attrs_a;
-	} else {
+	} else if (ops->oo_id_attrs) {
 		req_attrs = ops->oo_id_attrs;
+	} else {
+		req_attrs = 0xFFFFFFFF;
 	}
 	if (req_attrs == 0xFFFFFFFF)
 		req_attrs = a->ce_mask & b->ce_mask;
-- 
1.8.1.4




More information about the libnl mailing list