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:
parent
0e4f54d288
commit
3c28aa5dca
1 changed files with 2 additions and 0 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue