summaryrefslogtreecommitdiffstats
path: root/lib/xfrm
diff options
context:
space:
mode:
authorDavid Ahern <dsa@cumulusnetworks.com>2015-12-18 17:50:03 (GMT)
committerThomas Haller <thaller@redhat.com>2016-02-12 17:09:04 (GMT)
commita09b8558148b31e469d463907d103fa78d81612c (patch)
tree0ecd7ff2d09af28256b69d612beea3f0a6aff3ca /lib/xfrm
parent58396ae2ae7c91fb95d1de9654be5b12fd2343d2 (diff)
downloadlibnl-a09b8558148b31e469d463907d103fa78d81612c.zip
libnl-a09b8558148b31e469d463907d103fa78d81612c.tar.gz
libnl-a09b8558148b31e469d463907d103fa78d81612c.tar.bz2
lib: update ce-mask to uint64_t
lib/route/link.c already defines 32 attributes which fills the current uint32_t used for ce_mask. To accommodate more attributes the mask needs to be expanded. This patch updates the definition to uint64_t. The nl_object_diff API is maintained for ABI with existing users. A new nl_object_diff64 API is added for the expanded attribute list. The MSB of the 32-bit API is used to indicate if higher order attributes had a mismatch. (Suggested by Thomas). Note that LINK_ATTR_LINK_NETNSID changes. But since the attribute flags are not public API it shouldn't be a problem. http://lists.infradead.org/pipermail/libnl/2015-December/002078.html http://lists.infradead.org/pipermail/libnl/2015-December/002083.html Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib/xfrm')
-rw-r--r--lib/xfrm/ae.c6
-rw-r--r--lib/xfrm/sa.c5
-rw-r--r--lib/xfrm/sp.c5
3 files changed, 10 insertions, 6 deletions
diff --git a/lib/xfrm/ae.c b/lib/xfrm/ae.c
index 4fe9647..bfe481f 100644
--- a/lib/xfrm/ae.c
+++ b/lib/xfrm/ae.c
@@ -181,11 +181,13 @@ static int xfrm_ae_clone(struct nl_object *_dst, struct nl_object *_src)
return 0;
}
-static int xfrm_ae_compare(struct nl_object *_a, struct nl_object *_b, uint32_t attrs, int flags)
+static uint64_t xfrm_ae_compare(struct nl_object *_a, struct nl_object *_b,
+ uint64_t attrs, int flags)
{
struct xfrmnl_ae* a = (struct xfrmnl_ae *) _a;
struct xfrmnl_ae* b = (struct xfrmnl_ae *) _b;
- int diff = 0, found = 0;
+ uint64_t diff = 0;
+ int found = 0;
#define XFRM_AE_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, XFRM_AE_ATTR_##ATTR, a, b, EXPR)
diff |= XFRM_AE_DIFF(DADDR, nl_addr_cmp(a->sa_id.daddr, b->sa_id.daddr));
diff --git a/lib/xfrm/sa.c b/lib/xfrm/sa.c
index 34d24cf..31c22ba 100644
--- a/lib/xfrm/sa.c
+++ b/lib/xfrm/sa.c
@@ -205,11 +205,12 @@ static int xfrm_sa_clone(struct nl_object *_dst, struct nl_object *_src)
return 0;
}
-static int xfrm_sa_compare(struct nl_object *_a, struct nl_object *_b, uint32_t attrs, int flags)
+static uint64_t xfrm_sa_compare(struct nl_object *_a, struct nl_object *_b,
+ uint64_t attrs, int flags)
{
struct xfrmnl_sa* a = (struct xfrmnl_sa *) _a;
struct xfrmnl_sa* b = (struct xfrmnl_sa *) _b;
- int diff = 0;
+ uint64_t diff = 0;
int found = 0;
#define XFRM_SA_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, XFRM_SA_ATTR_##ATTR, a, b, EXPR)
diff --git a/lib/xfrm/sp.c b/lib/xfrm/sp.c
index 943269a..cc2fcb1 100644
--- a/lib/xfrm/sp.c
+++ b/lib/xfrm/sp.c
@@ -138,12 +138,13 @@ static int xfrm_sp_clone(struct nl_object *_dst, struct nl_object *_src)
return 0;
}
-static int xfrm_sp_compare(struct nl_object *_a, struct nl_object *_b, uint32_t attrs, int flags)
+static uint64_t xfrm_sp_compare(struct nl_object *_a, struct nl_object *_b,
+ uint64_t attrs, int flags)
{
struct xfrmnl_sp* a = (struct xfrmnl_sp *) _a;
struct xfrmnl_sp* b = (struct xfrmnl_sp *) _b;
struct xfrmnl_user_tmpl *tmpl_a, *tmpl_b;
- int diff = 0;
+ uint64_t diff = 0;
#define XFRM_SP_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, XFRM_SP_ATTR_##ATTR, a, b, EXPR)
diff |= XFRM_SP_DIFF(SEL, xfrmnl_sel_cmp(a->sel, b->sel));