diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2016-06-07 10:27:54 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-06-25 15:51:45 (GMT) |
commit | 9702bb14ffb237af7c430f4699ff97e4909f6e9a (patch) | |
tree | 0863fc36653b2214dea2e6ea82012aa7f587ae3e /lib | |
parent | a24319393ced15d611645fec6004284d96c042cd (diff) | |
download | libnl-9702bb14ffb237af7c430f4699ff97e4909f6e9a.zip libnl-9702bb14ffb237af7c430f4699ff97e4909f6e9a.tar.gz libnl-9702bb14ffb237af7c430f4699ff97e4909f6e9a.tar.bz2 |
pass flags through ->io_compare op
Currently rtnl_link_info_data_compare doesn't pass
flags (LOOSE_COMPARISON) to the ->io_compare op, so we cannot do a match
on only the attributes that are actually set in the filter object used
in a cache lookup via nl_cache_find().
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/route/link.c | 2 | ||||
-rw-r--r-- | lib/route/link/api.c | 4 | ||||
-rw-r--r-- | lib/route/link/vxlan.c | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/lib/route/link.c b/lib/route/link.c index 1b4f94c..4f86b0e 100644 --- a/lib/route/link.c +++ b/lib/route/link.c @@ -1008,7 +1008,7 @@ static uint64_t link_compare(struct nl_object *_a, struct nl_object *_b, goto protinfo_mismatch; } - diff |= LINK_DIFF(LINKINFO, rtnl_link_info_data_compare(a, b) != 0); + diff |= LINK_DIFF(LINKINFO, rtnl_link_info_data_compare(a, b, flags) != 0); out: return diff; diff --git a/lib/route/link/api.c b/lib/route/link/api.c index 00893ad..d406783 100644 --- a/lib/route/link/api.c +++ b/lib/route/link/api.c @@ -402,7 +402,7 @@ out: * @return 0 if link_info data matches or is not present * or != 0 if it mismatches. */ -int rtnl_link_info_data_compare(struct rtnl_link *a, struct rtnl_link *b) +int rtnl_link_info_data_compare(struct rtnl_link *a, struct rtnl_link *b, int flags) { if (a->l_info_ops != b->l_info_ops) return ~0; @@ -410,7 +410,7 @@ int rtnl_link_info_data_compare(struct rtnl_link *a, struct rtnl_link *b) if (!a->l_info_ops || !a->l_info_ops->io_compare) return 0; - return a->l_info_ops->io_compare(a, b, ~0, 0); + return a->l_info_ops->io_compare(a, b, flags); } /** @} */ diff --git a/lib/route/link/vxlan.c b/lib/route/link/vxlan.c index 10387bd..fd57351 100644 --- a/lib/route/link/vxlan.c +++ b/lib/route/link/vxlan.c @@ -446,11 +446,12 @@ nla_put_failure: } static int vxlan_compare(struct rtnl_link *link_a, struct rtnl_link *link_b, - uint32_t attrs, int flags) + int flags) { struct vxlan_info *a = link_a->l_info; struct vxlan_info *b = link_b->l_info; int diff = 0; + uint32_t attrs = ~0; #define VXLAN_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, VXLAN_ATTR_##ATTR, a, b, EXPR) |