libnftnl: Upgrade to 1.1.1

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
Alex Kiernan 2018-11-10 18:48:00 +00:00 committed by Armin Kuster
parent 532752fe3b
commit a0571f8b27
4 changed files with 441 additions and 3068 deletions

View File

@ -0,0 +1,289 @@
From 21eb59fbd071ebffb8495232766824944fb521a0 Mon Sep 17 00:00:00 2001
From: Alex Kiernan <alex.kiernan@gmail.com>
Date: Wed, 7 Nov 2018 21:19:53 +0000
Subject: [PATCH] Move exports before symbol definition
Based on 7966020 ("src: Fix exporting symbols with clang"), when
EXPORT_SYMBOL is located after function definition, clang won't properly
export the function, resulting in a library with no symbols when built with
clang.
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
src/flowtable.c | 54 +++++++++++++++++++++++++++---------------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/src/flowtable.c b/src/flowtable.c
index c1ddae4..d7434e3 100644
--- a/src/flowtable.c
+++ b/src/flowtable.c
@@ -34,12 +34,13 @@ struct nftnl_flowtable {
uint32_t flags;
};
+EXPORT_SYMBOL(nftnl_flowtable_alloc);
struct nftnl_flowtable *nftnl_flowtable_alloc(void)
{
return calloc(1, sizeof(struct nftnl_flowtable));
}
-EXPORT_SYMBOL(nftnl_flowtable_alloc);
+EXPORT_SYMBOL(nftnl_flowtable_free);
void nftnl_flowtable_free(const struct nftnl_flowtable *c)
{
int i;
@@ -56,14 +57,14 @@ void nftnl_flowtable_free(const struct nftnl_flowtable *c)
}
xfree(c);
}
-EXPORT_SYMBOL(nftnl_flowtable_free);
+EXPORT_SYMBOL(nftnl_flowtable_is_set);
bool nftnl_flowtable_is_set(const struct nftnl_flowtable *c, uint16_t attr)
{
return c->flags & (1 << attr);
}
-EXPORT_SYMBOL(nftnl_flowtable_is_set);
+EXPORT_SYMBOL(nftnl_flowtable_unset);
void nftnl_flowtable_unset(struct nftnl_flowtable *c, uint16_t attr)
{
int i;
@@ -96,7 +97,6 @@ void nftnl_flowtable_unset(struct nftnl_flowtable *c, uint16_t attr)
c->flags &= ~(1 << attr);
}
-EXPORT_SYMBOL(nftnl_flowtable_unset);
static uint32_t nftnl_flowtable_validate[NFTNL_FLOWTABLE_MAX + 1] = {
[NFTNL_FLOWTABLE_HOOKNUM] = sizeof(uint32_t),
@@ -105,6 +105,7 @@ static uint32_t nftnl_flowtable_validate[NFTNL_FLOWTABLE_MAX + 1] = {
[NFTNL_FLOWTABLE_FLAGS] = sizeof(uint32_t),
};
+EXPORT_SYMBOL(nftnl_flowtable_set_data);
int nftnl_flowtable_set_data(struct nftnl_flowtable *c, uint16_t attr,
const void *data, uint32_t data_len)
{
@@ -170,32 +171,32 @@ int nftnl_flowtable_set_data(struct nftnl_flowtable *c, uint16_t attr,
c->flags |= (1 << attr);
return 0;
}
-EXPORT_SYMBOL(nftnl_flowtable_set_data);
+EXPORT_SYMBOL(nftnl_flowtable_set);
void nftnl_flowtable_set(struct nftnl_flowtable *c, uint16_t attr, const void *data)
{
nftnl_flowtable_set_data(c, attr, data, nftnl_flowtable_validate[attr]);
}
-EXPORT_SYMBOL(nftnl_flowtable_set);
+EXPORT_SYMBOL(nftnl_flowtable_set_u32);
void nftnl_flowtable_set_u32(struct nftnl_flowtable *c, uint16_t attr, uint32_t data)
{
nftnl_flowtable_set_data(c, attr, &data, sizeof(uint32_t));
}
-EXPORT_SYMBOL(nftnl_flowtable_set_u32);
+EXPORT_SYMBOL(nftnl_flowtable_set_s32);
void nftnl_flowtable_set_s32(struct nftnl_flowtable *c, uint16_t attr, int32_t data)
{
nftnl_flowtable_set_data(c, attr, &data, sizeof(int32_t));
}
-EXPORT_SYMBOL(nftnl_flowtable_set_s32);
+EXPORT_SYMBOL(nftnl_flowtable_set_str);
int nftnl_flowtable_set_str(struct nftnl_flowtable *c, uint16_t attr, const char *str)
{
return nftnl_flowtable_set_data(c, attr, str, strlen(str) + 1);
}
-EXPORT_SYMBOL(nftnl_flowtable_set_str);
+EXPORT_SYMBOL(nftnl_flowtable_get_data);
const void *nftnl_flowtable_get_data(const struct nftnl_flowtable *c,
uint16_t attr, uint32_t *data_len)
{
@@ -229,21 +230,21 @@ const void *nftnl_flowtable_get_data(const struct nftnl_flowtable *c,
}
return NULL;
}
-EXPORT_SYMBOL(nftnl_flowtable_get_data);
+EXPORT_SYMBOL(nftnl_flowtable_get);
const void *nftnl_flowtable_get(const struct nftnl_flowtable *c, uint16_t attr)
{
uint32_t data_len;
return nftnl_flowtable_get_data(c, attr, &data_len);
}
-EXPORT_SYMBOL(nftnl_flowtable_get);
+EXPORT_SYMBOL(nftnl_flowtable_get_str);
const char *nftnl_flowtable_get_str(const struct nftnl_flowtable *c, uint16_t attr)
{
return nftnl_flowtable_get(c, attr);
}
-EXPORT_SYMBOL(nftnl_flowtable_get_str);
+EXPORT_SYMBOL(nftnl_flowtable_get_u32);
uint32_t nftnl_flowtable_get_u32(const struct nftnl_flowtable *c, uint16_t attr)
{
uint32_t data_len;
@@ -253,8 +254,8 @@ uint32_t nftnl_flowtable_get_u32(const struct nftnl_flowtable *c, uint16_t attr)
return val ? *val : 0;
}
-EXPORT_SYMBOL(nftnl_flowtable_get_u32);
+EXPORT_SYMBOL(nftnl_flowtable_get_s32);
int32_t nftnl_flowtable_get_s32(const struct nftnl_flowtable *c, uint16_t attr)
{
uint32_t data_len;
@@ -264,8 +265,8 @@ int32_t nftnl_flowtable_get_s32(const struct nftnl_flowtable *c, uint16_t attr)
return val ? *val : 0;
}
-EXPORT_SYMBOL(nftnl_flowtable_get_s32);
+EXPORT_SYMBOL(nftnl_flowtable_nlmsg_build_payload);
void nftnl_flowtable_nlmsg_build_payload(struct nlmsghdr *nlh,
const struct nftnl_flowtable *c)
{
@@ -301,7 +302,6 @@ void nftnl_flowtable_nlmsg_build_payload(struct nlmsghdr *nlh,
if (c->flags & (1 << NFTNL_FLOWTABLE_SIZE))
mnl_attr_put_u32(nlh, NFTA_FLOWTABLE_SIZE, htonl(c->size));
}
-EXPORT_SYMBOL(nftnl_flowtable_nlmsg_build_payload);
static int nftnl_flowtable_parse_attr_cb(const struct nlattr *attr, void *data)
{
@@ -412,6 +412,7 @@ static int nftnl_flowtable_parse_hook(struct nlattr *attr, struct nftnl_flowtabl
return 0;
}
+EXPORT_SYMBOL(nftnl_flowtable_nlmsg_parse);
int nftnl_flowtable_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_flowtable *c)
{
struct nlattr *tb[NFTA_FLOWTABLE_MAX + 1] = {};
@@ -460,7 +461,6 @@ int nftnl_flowtable_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_flowtab
return ret;
}
-EXPORT_SYMBOL(nftnl_flowtable_nlmsg_parse);
static const char *nftnl_hooknum2str(int family, int hooknum)
{
@@ -612,20 +612,20 @@ static int nftnl_flowtable_do_parse(struct nftnl_flowtable *c,
return ret;
}
+EXPORT_SYMBOL(nftnl_flowtable_parse);
int nftnl_flowtable_parse(struct nftnl_flowtable *c, enum nftnl_parse_type type,
const char *data, struct nftnl_parse_err *err)
{
return nftnl_flowtable_do_parse(c, type, data, err, NFTNL_PARSE_BUFFER);
}
-EXPORT_SYMBOL(nftnl_flowtable_parse);
+EXPORT_SYMBOL(nftnl_flowtable_parse_file);
int nftnl_flowtable_parse_file(struct nftnl_flowtable *c,
enum nftnl_parse_type type,
FILE *fp, struct nftnl_parse_err *err)
{
return nftnl_flowtable_do_parse(c, type, fp, err, NFTNL_PARSE_FILE);
}
-EXPORT_SYMBOL(nftnl_flowtable_parse_file);
static int nftnl_flowtable_export(char *buf, size_t size,
const struct nftnl_flowtable *c, int type)
@@ -720,6 +720,7 @@ static int nftnl_flowtable_cmd_snprintf(char *buf, size_t size,
return offset;
}
+EXPORT_SYMBOL(nftnl_flowtable_snprintf);
int nftnl_flowtable_snprintf(char *buf, size_t size, const struct nftnl_flowtable *c,
uint32_t type, uint32_t flags)
{
@@ -729,7 +730,6 @@ int nftnl_flowtable_snprintf(char *buf, size_t size, const struct nftnl_flowtabl
return nftnl_flowtable_cmd_snprintf(buf, size, c, nftnl_flag2cmd(flags),
type, flags);
}
-EXPORT_SYMBOL(nftnl_flowtable_snprintf);
static int nftnl_flowtable_do_snprintf(char *buf, size_t size, const void *c,
uint32_t cmd, uint32_t type, uint32_t flags)
@@ -737,18 +737,19 @@ static int nftnl_flowtable_do_snprintf(char *buf, size_t size, const void *c,
return nftnl_flowtable_snprintf(buf, size, c, type, flags);
}
+EXPORT_SYMBOL(nftnl_flowtable_fprintf);
int nftnl_flowtable_fprintf(FILE *fp, const struct nftnl_flowtable *c,
uint32_t type, uint32_t flags)
{
return nftnl_fprintf(fp, c, NFTNL_CMD_UNSPEC, type, flags,
nftnl_flowtable_do_snprintf);
}
-EXPORT_SYMBOL(nftnl_flowtable_fprintf);
struct nftnl_flowtable_list {
struct list_head list;
};
+EXPORT_SYMBOL(nftnl_flowtable_list_alloc);
struct nftnl_flowtable_list *nftnl_flowtable_list_alloc(void)
{
struct nftnl_flowtable_list *list;
@@ -761,8 +762,8 @@ struct nftnl_flowtable_list *nftnl_flowtable_list_alloc(void)
return list;
}
-EXPORT_SYMBOL(nftnl_flowtable_list_alloc);
+EXPORT_SYMBOL(nftnl_flowtable_list_free);
void nftnl_flowtable_list_free(struct nftnl_flowtable_list *list)
{
struct nftnl_flowtable *s, *tmp;
@@ -773,34 +774,34 @@ void nftnl_flowtable_list_free(struct nftnl_flowtable_list *list)
}
xfree(list);
}
-EXPORT_SYMBOL(nftnl_flowtable_list_free);
+EXPORT_SYMBOL(nftnl_flowtable_list_is_empty);
int nftnl_flowtable_list_is_empty(const struct nftnl_flowtable_list *list)
{
return list_empty(&list->list);
}
-EXPORT_SYMBOL(nftnl_flowtable_list_is_empty);
+EXPORT_SYMBOL(nftnl_flowtable_list_add);
void nftnl_flowtable_list_add(struct nftnl_flowtable *s,
struct nftnl_flowtable_list *list)
{
list_add(&s->head, &list->list);
}
-EXPORT_SYMBOL(nftnl_flowtable_list_add);
+EXPORT_SYMBOL(nftnl_flowtable_list_add_tail);
void nftnl_flowtable_list_add_tail(struct nftnl_flowtable *s,
struct nftnl_flowtable_list *list)
{
list_add_tail(&s->head, &list->list);
}
-EXPORT_SYMBOL(nftnl_flowtable_list_add_tail);
+EXPORT_SYMBOL(nftnl_flowtable_list_del);
void nftnl_flowtable_list_del(struct nftnl_flowtable *s)
{
list_del(&s->head);
}
-EXPORT_SYMBOL(nftnl_flowtable_list_del);
+EXPORT_SYMBOL(nftnl_flowtable_list_foreach);
int nftnl_flowtable_list_foreach(struct nftnl_flowtable_list *flowtable_list,
int (*cb)(struct nftnl_flowtable *t, void *data), void *data)
{
@@ -814,4 +815,3 @@ int nftnl_flowtable_list_foreach(struct nftnl_flowtable_list *flowtable_list,
}
return 0;
}
-EXPORT_SYMBOL(nftnl_flowtable_list_foreach);

View File

@ -1,51 +1,55 @@
From f840cc0da571d98beb17855c177e9986bd096b72 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 13 Apr 2017 11:46:09 -0700
From 5ea9fa9d345005f2f53b1b598edb85f5f24ca9da Mon Sep 17 00:00:00 2001
From: Alex Kiernan <alex.kiernan@gmail.com>
Date: Wed, 7 Nov 2018 19:41:54 +0000
Subject: [PATCH] avoid naming local function as one of printf family
Fixes build issues with clang
error: no member named '__builtin___snprintf_chk' in 'struct expr_ops'
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
include/expr_ops.h | 2 +-
include/obj.h | 2 +-
src/buffer.c | 2 +-
src/expr.c | 4 ++--
src/expr/bitwise.c | 2 +-
src/expr/byteorder.c | 2 +-
src/expr/cmp.c | 2 +-
src/expr/counter.c | 2 +-
src/expr/ct.c | 2 +-
src/expr/dup.c | 2 +-
src/expr/dynset.c | 2 +-
src/expr/exthdr.c | 2 +-
src/expr/fib.c | 2 +-
src/expr/fwd.c | 2 +-
src/expr/hash.c | 2 +-
src/expr/immediate.c | 2 +-
src/expr/limit.c | 2 +-
src/expr/log.c | 2 +-
src/expr/lookup.c | 2 +-
src/expr/masq.c | 2 +-
src/expr/match.c | 2 +-
src/expr/meta.c | 2 +-
src/expr/nat.c | 2 +-
src/expr/numgen.c | 2 +-
src/expr/objref.c | 2 +-
src/expr/payload.c | 2 +-
src/expr/queue.c | 2 +-
src/expr/quota.c | 2 +-
src/expr/range.c | 2 +-
src/expr/redir.c | 2 +-
src/expr/reject.c | 2 +-
src/expr/rt.c | 2 +-
src/expr/target.c | 2 +-
src/obj/counter.c | 2 +-
src/obj/ct_helper.c | 2 +-
src/obj/quota.c | 2 +-
src/object.c | 4 ++--
37 files changed, 39 insertions(+), 39 deletions(-)
include/expr_ops.h | 2 +-
include/obj.h | 2 +-
src/expr.c | 4 ++--
src/expr/bitwise.c | 2 +-
src/expr/byteorder.c | 2 +-
src/expr/cmp.c | 2 +-
src/expr/connlimit.c | 2 +-
src/expr/counter.c | 2 +-
src/expr/ct.c | 2 +-
src/expr/dup.c | 2 +-
src/expr/dynset.c | 2 +-
src/expr/exthdr.c | 2 +-
src/expr/fib.c | 2 +-
src/expr/flow_offload.c | 2 +-
src/expr/fwd.c | 2 +-
src/expr/hash.c | 2 +-
src/expr/immediate.c | 2 +-
src/expr/limit.c | 2 +-
src/expr/log.c | 2 +-
src/expr/lookup.c | 2 +-
src/expr/masq.c | 2 +-
src/expr/match.c | 2 +-
src/expr/meta.c | 2 +-
src/expr/nat.c | 2 +-
src/expr/numgen.c | 2 +-
src/expr/objref.c | 2 +-
src/expr/payload.c | 2 +-
src/expr/queue.c | 2 +-
src/expr/quota.c | 2 +-
src/expr/range.c | 2 +-
src/expr/redir.c | 2 +-
src/expr/reject.c | 2 +-
src/expr/rt.c | 2 +-
src/expr/socket.c | 2 +-
src/expr/target.c | 2 +-
src/obj/counter.c | 2 +-
src/obj/ct_helper.c | 2 +-
src/obj/limit.c | 2 +-
src/obj/quota.c | 2 +-
src/object.c | 4 ++--
40 files changed, 42 insertions(+), 42 deletions(-)
diff --git a/include/expr_ops.h b/include/expr_ops.h
index e639390..c4fe050 100644
@ -61,10 +65,10 @@ index e639390..c4fe050 100644
struct nftnl_parse_err *err);
};
diff --git a/include/obj.h b/include/obj.h
index d90919f..772caff 100644
index 4a728c8..4c20bd1 100644
--- a/include/obj.h
+++ b/include/obj.h
@@ -47,7 +47,7 @@ struct obj_ops {
@@ -55,7 +55,7 @@ struct obj_ops {
const void *(*get)(const struct nftnl_obj *e, uint16_t type, uint32_t *data_len);
int (*parse)(struct nftnl_obj *e, struct nlattr *attr);
void (*build)(struct nlmsghdr *nlh, const struct nftnl_obj *e);
@ -73,38 +77,25 @@ index d90919f..772caff 100644
int (*json_parse)(struct nftnl_obj *e, json_t *data,
struct nftnl_parse_err *err);
};
diff --git a/src/buffer.c b/src/buffer.c
index f9d5a83..db656e2 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -206,7 +206,7 @@ int nftnl_buf_expr(struct nftnl_buf *b, int type, uint32_t flags,
case NFTNL_OUTPUT_JSON:
nftnl_buf_put(b, "{");
nftnl_buf_str(b, type, expr->ops->name, TYPE);
- ret = expr->ops->snprintf(b->buf + b->off, b->len, type, flags,
+ ret = expr->ops->snprintf_(b->buf + b->off, b->len, type, flags,
expr);
if (ret > 0)
nftnl_buf_update(b, ret);
diff --git a/src/expr.c b/src/expr.c
index c7eb2b4..24f8f8c 100644
index 62565e0..2489c30 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -265,10 +265,10 @@ int __EXPORTED nftnl_expr_snprintf(char *buf, size_t size, const struct nftnl_ex
int ret;
unsigned int offset = 0, len = size;
@@ -285,10 +285,10 @@ int nftnl_expr_snprintf(char *buf, size_t size, const struct nftnl_expr *expr,
if (size)
buf[0] = '\0';
- if (!expr->ops->snprintf)
+ if (!expr->ops->snprintf_)
return 0;
- ret = expr->ops->snprintf(buf+offset, len, type, flags, expr);
+ ret = expr->ops->snprintf_(buf+offset, len, type, flags, expr);
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
- ret = expr->ops->snprintf(buf + offset, remain, type, flags, expr);
+ ret = expr->ops->snprintf_(buf + offset, remain, type, flags, expr);
SNPRINTF_BUFFER_SIZE(ret, remain, offset);
return offset;
diff --git a/src/expr/bitwise.c b/src/expr/bitwise.c
index 0febc9d..9b48e79 100644
index a89734b..f8360b1 100644
--- a/src/expr/bitwise.c
+++ b/src/expr/bitwise.c
@@ -299,6 +299,6 @@ struct expr_ops expr_ops_bitwise = {
@ -116,7 +107,7 @@ index 0febc9d..9b48e79 100644
.json_parse = nftnl_expr_bitwise_json_parse,
};
diff --git a/src/expr/byteorder.c b/src/expr/byteorder.c
index 3805307..079582f 100644
index 47c04cf..61f733f 100644
--- a/src/expr/byteorder.c
+++ b/src/expr/byteorder.c
@@ -314,6 +314,6 @@ struct expr_ops expr_ops_byteorder = {
@ -128,7 +119,7 @@ index 3805307..079582f 100644
.json_parse = nftnl_expr_byteorder_json_parse,
};
diff --git a/src/expr/cmp.c b/src/expr/cmp.c
index 353e907..99b497c 100644
index b26d0eb..522c7be 100644
--- a/src/expr/cmp.c
+++ b/src/expr/cmp.c
@@ -284,6 +284,6 @@ struct expr_ops expr_ops_cmp = {
@ -139,6 +130,18 @@ index 353e907..99b497c 100644
+ .snprintf_ = nftnl_expr_cmp_snprintf,
.json_parse = nftnl_expr_cmp_json_parse,
};
diff --git a/src/expr/connlimit.c b/src/expr/connlimit.c
index 60965b5..4e41866 100644
--- a/src/expr/connlimit.c
+++ b/src/expr/connlimit.c
@@ -202,6 +202,6 @@ struct expr_ops expr_ops_connlimit = {
.get = nftnl_expr_connlimit_get,
.parse = nftnl_expr_connlimit_parse,
.build = nftnl_expr_connlimit_build,
- .snprintf = nftnl_expr_connlimit_snprintf,
+ .snprintf_ = nftnl_expr_connlimit_snprintf,
.json_parse = nftnl_expr_connlimit_json_parse,
};
diff --git a/src/expr/counter.c b/src/expr/counter.c
index 21901e8..9fd7655 100644
--- a/src/expr/counter.c
@ -152,10 +155,10 @@ index 21901e8..9fd7655 100644
.json_parse = nftnl_expr_counter_json_parse,
};
diff --git a/src/expr/ct.c b/src/expr/ct.c
index cdd08e9..6ce5478 100644
index 39e9be6..b363f7c 100644
--- a/src/expr/ct.c
+++ b/src/expr/ct.c
@@ -356,6 +356,6 @@ struct expr_ops expr_ops_ct = {
@@ -357,6 +357,6 @@ struct expr_ops expr_ops_ct = {
.get = nftnl_expr_ct_get,
.parse = nftnl_expr_ct_parse,
.build = nftnl_expr_ct_build,
@ -164,7 +167,7 @@ index cdd08e9..6ce5478 100644
.json_parse = nftnl_expr_ct_json_parse,
};
diff --git a/src/expr/dup.c b/src/expr/dup.c
index 9aa332b..2f491d8 100644
index ed8e620..8d603e3 100644
--- a/src/expr/dup.c
+++ b/src/expr/dup.c
@@ -206,6 +206,6 @@ struct expr_ops expr_ops_dup = {
@ -176,7 +179,7 @@ index 9aa332b..2f491d8 100644
.json_parse = nftnl_expr_dup_json_parse,
};
diff --git a/src/expr/dynset.c b/src/expr/dynset.c
index f7b99ea..758f07c 100644
index 160d0e1..a43f4da 100644
--- a/src/expr/dynset.c
+++ b/src/expr/dynset.c
@@ -368,6 +368,6 @@ struct expr_ops expr_ops_dynset = {
@ -188,10 +191,10 @@ index f7b99ea..758f07c 100644
.json_parse = nftnl_expr_dynset_json_parse,
};
diff --git a/src/expr/exthdr.c b/src/expr/exthdr.c
index d4f1665..a834782 100644
index 75cafbc..89ea7f5 100644
--- a/src/expr/exthdr.c
+++ b/src/expr/exthdr.c
@@ -356,6 +356,6 @@ struct expr_ops expr_ops_exthdr = {
@@ -385,6 +385,6 @@ struct expr_ops expr_ops_exthdr = {
.get = nftnl_expr_exthdr_get,
.parse = nftnl_expr_exthdr_parse,
.build = nftnl_expr_exthdr_build,
@ -200,10 +203,10 @@ index d4f1665..a834782 100644
.json_parse = nftnl_expr_exthdr_json_parse,
};
diff --git a/src/expr/fib.c b/src/expr/fib.c
index f3be081..3c353b2 100644
index b922b26..ece4645 100644
--- a/src/expr/fib.c
+++ b/src/expr/fib.c
@@ -272,6 +272,6 @@ struct expr_ops expr_ops_fib = {
@@ -274,6 +274,6 @@ struct expr_ops expr_ops_fib = {
.get = nftnl_expr_fib_get,
.parse = nftnl_expr_fib_parse,
.build = nftnl_expr_fib_build,
@ -211,11 +214,23 @@ index f3be081..3c353b2 100644
+ .snprintf_ = nftnl_expr_fib_snprintf,
.json_parse = nftnl_expr_fib_json_parse,
};
diff --git a/src/expr/flow_offload.c b/src/expr/flow_offload.c
index a2001c9..9cdbc21 100644
--- a/src/expr/flow_offload.c
+++ b/src/expr/flow_offload.c
@@ -179,6 +179,6 @@ struct expr_ops expr_ops_flow = {
.get = nftnl_expr_flow_get,
.parse = nftnl_expr_flow_parse,
.build = nftnl_expr_flow_build,
- .snprintf = nftnl_expr_flow_snprintf,
+ .snprintf_ = nftnl_expr_flow_snprintf,
.json_parse = nftnl_expr_flow_json_parse,
};
diff --git a/src/expr/fwd.c b/src/expr/fwd.c
index c30d494..f6e41f1 100644
index 9021606..7178f43 100644
--- a/src/expr/fwd.c
+++ b/src/expr/fwd.c
@@ -180,6 +180,6 @@ struct expr_ops expr_ops_fwd = {
@@ -233,6 +233,6 @@ struct expr_ops expr_ops_fwd = {
.get = nftnl_expr_fwd_get,
.parse = nftnl_expr_fwd_parse,
.build = nftnl_expr_fwd_build,
@ -224,10 +239,10 @@ index c30d494..f6e41f1 100644
.json_parse = nftnl_expr_fwd_json_parse,
};
diff --git a/src/expr/hash.c b/src/expr/hash.c
index d870510..5acb66a 100644
index 415537e..186c5b0 100644
--- a/src/expr/hash.c
+++ b/src/expr/hash.c
@@ -332,6 +332,6 @@ struct expr_ops expr_ops_hash = {
@@ -383,6 +383,6 @@ struct expr_ops expr_ops_hash = {
.get = nftnl_expr_hash_get,
.parse = nftnl_expr_hash_parse,
.build = nftnl_expr_hash_build,
@ -236,7 +251,7 @@ index d870510..5acb66a 100644
.json_parse = nftnl_expr_hash_json_parse,
};
diff --git a/src/expr/immediate.c b/src/expr/immediate.c
index 0b188cc..94bd6da 100644
index b0570bd..91ccbdc 100644
--- a/src/expr/immediate.c
+++ b/src/expr/immediate.c
@@ -316,6 +316,6 @@ struct expr_ops expr_ops_immediate = {
@ -260,10 +275,10 @@ index 856ab18..e71fc2f 100644
.json_parse = nftnl_expr_limit_json_parse,
};
diff --git a/src/expr/log.c b/src/expr/log.c
index b642255..71dd83a 100644
index 86d9651..5769c1c 100644
--- a/src/expr/log.c
+++ b/src/expr/log.c
@@ -352,6 +352,6 @@ struct expr_ops expr_ops_log = {
@@ -353,6 +353,6 @@ struct expr_ops expr_ops_log = {
.get = nftnl_expr_log_get,
.parse = nftnl_expr_log_parse,
.build = nftnl_expr_log_build,
@ -272,10 +287,10 @@ index b642255..71dd83a 100644
.json_parse = nftnl_expr_log_json_parse,
};
diff --git a/src/expr/lookup.c b/src/expr/lookup.c
index 861815f..6049913 100644
index 5fcb81f..b2f0dd6 100644
--- a/src/expr/lookup.c
+++ b/src/expr/lookup.c
@@ -293,6 +293,6 @@ struct expr_ops expr_ops_lookup = {
@@ -292,6 +292,6 @@ struct expr_ops expr_ops_lookup = {
.get = nftnl_expr_lookup_get,
.parse = nftnl_expr_lookup_parse,
.build = nftnl_expr_lookup_build,
@ -308,10 +323,10 @@ index dd09e1e..f0d8868 100644
.json_parse = nftnl_expr_match_json_parse,
};
diff --git a/src/expr/meta.c b/src/expr/meta.c
index 2c75841..907a677 100644
index de82105..91f1ebb 100644
--- a/src/expr/meta.c
+++ b/src/expr/meta.c
@@ -290,6 +290,6 @@ struct expr_ops expr_ops_meta = {
@@ -291,6 +291,6 @@ struct expr_ops expr_ops_meta = {
.get = nftnl_expr_meta_get,
.parse = nftnl_expr_meta_parse,
.build = nftnl_expr_meta_build,
@ -320,10 +335,10 @@ index 2c75841..907a677 100644
.json_parse = nftnl_expr_meta_json_parse,
};
diff --git a/src/expr/nat.c b/src/expr/nat.c
index 29bc3a2..d476283 100644
index 9271303..427c282 100644
--- a/src/expr/nat.c
+++ b/src/expr/nat.c
@@ -383,6 +383,6 @@ struct expr_ops expr_ops_nat = {
@@ -384,6 +384,6 @@ struct expr_ops expr_ops_nat = {
.get = nftnl_expr_nat_get,
.parse = nftnl_expr_nat_parse,
.build = nftnl_expr_nat_build,
@ -332,10 +347,10 @@ index 29bc3a2..d476283 100644
.json_parse = nftnl_expr_nat_json_parse,
};
diff --git a/src/expr/numgen.c b/src/expr/numgen.c
index a15f03a..28ef741 100644
index 5336fde..8e0479a 100644
--- a/src/expr/numgen.c
+++ b/src/expr/numgen.c
@@ -264,6 +264,6 @@ struct expr_ops expr_ops_ng = {
@@ -313,6 +313,6 @@ struct expr_ops expr_ops_ng = {
.get = nftnl_expr_ng_get,
.parse = nftnl_expr_ng_parse,
.build = nftnl_expr_ng_build,
@ -344,7 +359,7 @@ index a15f03a..28ef741 100644
.json_parse = nftnl_expr_ng_json_parse,
};
diff --git a/src/expr/objref.c b/src/expr/objref.c
index 4cfa3cb..c394290 100644
index 64ee863..4504488 100644
--- a/src/expr/objref.c
+++ b/src/expr/objref.c
@@ -278,6 +278,6 @@ struct expr_ops expr_ops_objref = {
@ -368,10 +383,10 @@ index 91e1587..894ac08 100644
.json_parse = nftnl_expr_payload_json_parse,
};
diff --git a/src/expr/queue.c b/src/expr/queue.c
index 8a9deda..389af83 100644
index a392a27..ee26c10 100644
--- a/src/expr/queue.c
+++ b/src/expr/queue.c
@@ -276,6 +276,6 @@ struct expr_ops expr_ops_queue = {
@@ -275,6 +275,6 @@ struct expr_ops expr_ops_queue = {
.get = nftnl_expr_queue_get,
.parse = nftnl_expr_queue_parse,
.build = nftnl_expr_queue_build,
@ -392,7 +407,7 @@ index 667e6e1..ff5d182 100644
.json_parse = nftnl_expr_quota_json_parse,
};
diff --git a/src/expr/range.c b/src/expr/range.c
index 8c8ce12..34d422b 100644
index b2789ff..8910f8a 100644
--- a/src/expr/range.c
+++ b/src/expr/range.c
@@ -283,6 +283,6 @@ struct expr_ops expr_ops_range = {
@ -404,7 +419,7 @@ index 8c8ce12..34d422b 100644
.json_parse = nftnl_expr_range_json_parse,
};
diff --git a/src/expr/redir.c b/src/expr/redir.c
index 43538d5..8a21f93 100644
index b2aa345..41b77ab 100644
--- a/src/expr/redir.c
+++ b/src/expr/redir.c
@@ -242,6 +242,6 @@ struct expr_ops expr_ops_redir = {
@ -428,10 +443,10 @@ index 11d8b20..b10e729 100644
.json_parse = nftnl_expr_reject_json_parse,
};
diff --git a/src/expr/rt.c b/src/expr/rt.c
index 5088e66..9f44b29 100644
index c3c92c7..688a042 100644
--- a/src/expr/rt.c
+++ b/src/expr/rt.c
@@ -238,6 +238,6 @@ struct expr_ops expr_ops_rt = {
@@ -235,6 +235,6 @@ struct expr_ops expr_ops_rt = {
.get = nftnl_expr_rt_get,
.parse = nftnl_expr_rt_parse,
.build = nftnl_expr_rt_build,
@ -439,6 +454,17 @@ index 5088e66..9f44b29 100644
+ .snprintf_ = nftnl_expr_rt_snprintf,
.json_parse = nftnl_expr_rt_json_parse,
};
diff --git a/src/expr/socket.c b/src/expr/socket.c
index db160a1..4c50011 100644
--- a/src/expr/socket.c
+++ b/src/expr/socket.c
@@ -204,5 +204,5 @@ struct expr_ops expr_ops_socket = {
.get = nftnl_expr_socket_get,
.parse = nftnl_expr_socket_parse,
.build = nftnl_expr_socket_build,
- .snprintf = nftnl_expr_socket_snprintf,
+ .snprintf_ = nftnl_expr_socket_snprintf,
};
diff --git a/src/expr/target.c b/src/expr/target.c
index ed4bf7d..2ef4078 100644
--- a/src/expr/target.c
@ -452,10 +478,10 @@ index ed4bf7d..2ef4078 100644
.json_parse = nftnl_expr_target_json_parse,
};
diff --git a/src/obj/counter.c b/src/obj/counter.c
index beadc93..8c4cc25 100644
index 332bb2b..edeb7be 100644
--- a/src/obj/counter.c
+++ b/src/obj/counter.c
@@ -179,6 +179,6 @@ struct obj_ops obj_ops_counter = {
@@ -182,6 +182,6 @@ struct obj_ops obj_ops_counter = {
.get = nftnl_obj_counter_get,
.parse = nftnl_obj_counter_parse,
.build = nftnl_obj_counter_build,
@ -464,10 +490,10 @@ index beadc93..8c4cc25 100644
.json_parse = nftnl_obj_counter_json_parse,
};
diff --git a/src/obj/ct_helper.c b/src/obj/ct_helper.c
index d6d3111..4c7c88b 100644
index 62569fe..69757ff 100644
--- a/src/obj/ct_helper.c
+++ b/src/obj/ct_helper.c
@@ -205,6 +205,6 @@ struct obj_ops obj_ops_ct_helper = {
@@ -208,6 +208,6 @@ struct obj_ops obj_ops_ct_helper = {
.get = nftnl_obj_ct_helper_get,
.parse = nftnl_obj_ct_helper_parse,
.build = nftnl_obj_ct_helper_build,
@ -475,11 +501,23 @@ index d6d3111..4c7c88b 100644
+ .snprintf_ = nftnl_obj_ct_helper_snprintf,
.json_parse = nftnl_obj_quota_json_parse,
};
diff --git a/src/obj/limit.c b/src/obj/limit.c
index 7f8bcf7..25018b6 100644
--- a/src/obj/limit.c
+++ b/src/obj/limit.c
@@ -236,6 +236,6 @@ struct obj_ops obj_ops_limit = {
.get = nftnl_obj_limit_get,
.parse = nftnl_obj_limit_parse,
.build = nftnl_obj_limit_build,
- .snprintf = nftnl_obj_limit_snprintf,
+ .snprintf_ = nftnl_obj_limit_snprintf,
.json_parse = nftnl_obj_limit_json_parse,
};
diff --git a/src/obj/quota.c b/src/obj/quota.c
index d5757b2..e959ff8 100644
index 6d36784..ecaa8b1 100644
--- a/src/obj/quota.c
+++ b/src/obj/quota.c
@@ -200,6 +200,6 @@ struct obj_ops obj_ops_quota = {
@@ -203,6 +203,6 @@ struct obj_ops obj_ops_quota = {
.get = nftnl_obj_quota_get,
.parse = nftnl_obj_quota_parse,
.build = nftnl_obj_quota_build,
@ -488,11 +526,11 @@ index d5757b2..e959ff8 100644
.json_parse = nftnl_obj_quota_json_parse,
};
diff --git a/src/object.c b/src/object.c
index d409c6d..b938c97 100644
index d8278f3..9654b7b 100644
--- a/src/object.c
+++ b/src/object.c
@@ -389,7 +389,7 @@ static int nftnl_obj_export(char *buf, size_t size,
nftnl_buf_u32(&b, type, obj->use, USE);
@@ -429,7 +429,7 @@ static int nftnl_obj_export(char *buf, size_t size,
nftnl_buf_u64(&b, type, obj->handle, HANDLE);
if (obj->ops)
- ret = obj->ops->snprintf(buf + b.len, size - b.len, type,
@ -500,15 +538,12 @@ index d409c6d..b938c97 100644
flags, obj);
b.len += ret;
@@ -410,7 +410,7 @@ static int nftnl_obj_snprintf_dflt(char *buf, size_t size,
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
@@ -450,7 +450,7 @@ static int nftnl_obj_snprintf_dflt(char *buf, size_t size,
SNPRINTF_BUFFER_SIZE(ret, remain, offset);
if (obj->ops) {
- ret = obj->ops->snprintf(buf + offset, offset, type, flags, obj);
+ ret = obj->ops->snprintf_(buf + offset, offset, type, flags, obj);
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
- ret = obj->ops->snprintf(buf + offset, offset, type, flags,
+ ret = obj->ops->snprintf_(buf + offset, offset, type, flags,
obj);
SNPRINTF_BUFFER_SIZE(ret, remain, offset);
}
ret = snprintf(buf + offset, offset, "]");
--
2.12.2

View File

@ -4,13 +4,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=79808397c3355f163c012616125c9e26"
SECTION = "libs"
DEPENDS = "libmnl"
PV .= "+git${SRCPV}"
SRCREV = "4b89c0cb0883f638ff1abbc2ff47c43cdc26aac5"
SRCREV = "d379dfcb6c94dcb93a8f16896572d6e162138e0f"
SRC_URI = "git://git.netfilter.org/libnftnl \
file://0001-Declare-the-define-visivility-attribute-together.patch \
file://0001-avoid-naming-local-function-as-one-of-printf-family.patch \
file://0001-Move-exports-before-symbol-definition.patch \
file://0002-avoid-naming-local-function-as-one-of-printf-family.patch \
"
SRC_URI[md5sum] = "82183867168eb6644926c48b991b8aac"
SRC_URI[sha256sum] = "9bb66ecbc64b8508249402f0093829f44177770ad99f6042b86b3a467d963982"
S = "${WORKDIR}/git"