summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSabrina Dubroca <sd@queasysnail.net>2016-06-07 10:27:54 (GMT)
committerThomas Haller <thaller@redhat.com>2016-06-25 15:51:45 (GMT)
commit9702bb14ffb237af7c430f4699ff97e4909f6e9a (patch)
tree0863fc36653b2214dea2e6ea82012aa7f587ae3e
parenta24319393ced15d611645fec6004284d96c042cd (diff)
downloadlibnl-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>
-rw-r--r--include/netlink-private/route/link/api.h5
-rw-r--r--lib/route/link.c2
-rw-r--r--lib/route/link/api.c4
-rw-r--r--lib/route/link/vxlan.c3
4 files changed, 8 insertions, 6 deletions
diff --git a/include/netlink-private/route/link/api.h b/include/netlink-private/route/link/api.h
index dedc921..1a793c8 100644
--- a/include/netlink-private/route/link/api.h
+++ b/include/netlink-private/route/link/api.h
@@ -62,7 +62,7 @@ struct rtnl_link_info_ops
/** Called to compare link info parameters between two links. */
int (*io_compare)(struct rtnl_link *, struct rtnl_link *,
- uint32_t attrs, int flags);
+ int flags);
struct nl_list_head io_list;
};
@@ -160,7 +160,8 @@ extern int rtnl_link_af_data_compare(struct rtnl_link *a,
struct rtnl_link *b,
int family);
extern int rtnl_link_info_data_compare(struct rtnl_link *a,
- struct rtnl_link *b);
+ struct rtnl_link *b,
+ int flags);
#ifdef __cplusplus
}
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)