libnftnl: Upgrade to 1.0.7

Fix build with clang while here

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
This commit is contained in:
Khem Raj 2017-04-18 11:21:19 -07:00 committed by Joe MacDonald
parent 9a98b3f665
commit 2571887a95
5 changed files with 3704 additions and 13 deletions

View File

@ -0,0 +1,514 @@
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
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>
---
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(-)
diff --git a/include/expr_ops.h b/include/expr_ops.h
index e639390..c4fe050 100644
--- a/include/expr_ops.h
+++ b/include/expr_ops.h
@@ -18,7 +18,7 @@ struct expr_ops {
const void *(*get)(const struct nftnl_expr *e, uint16_t type, uint32_t *data_len);
int (*parse)(struct nftnl_expr *e, struct nlattr *attr);
void (*build)(struct nlmsghdr *nlh, const struct nftnl_expr *e);
- int (*snprintf)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_expr *e);
+ int (*snprintf_)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_expr *e);
int (*json_parse)(struct nftnl_expr *e, json_t *data,
struct nftnl_parse_err *err);
};
diff --git a/include/obj.h b/include/obj.h
index d90919f..772caff 100644
--- a/include/obj.h
+++ b/include/obj.h
@@ -47,7 +47,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);
- int (*snprintf)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_obj *e);
+ int (*snprintf_)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_obj *e);
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
--- 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;
- 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);
return offset;
diff --git a/src/expr/bitwise.c b/src/expr/bitwise.c
index 0febc9d..9b48e79 100644
--- a/src/expr/bitwise.c
+++ b/src/expr/bitwise.c
@@ -299,6 +299,6 @@ struct expr_ops expr_ops_bitwise = {
.get = nftnl_expr_bitwise_get,
.parse = nftnl_expr_bitwise_parse,
.build = nftnl_expr_bitwise_build,
- .snprintf = nftnl_expr_bitwise_snprintf,
+ .snprintf_ = nftnl_expr_bitwise_snprintf,
.json_parse = nftnl_expr_bitwise_json_parse,
};
diff --git a/src/expr/byteorder.c b/src/expr/byteorder.c
index 3805307..079582f 100644
--- a/src/expr/byteorder.c
+++ b/src/expr/byteorder.c
@@ -314,6 +314,6 @@ struct expr_ops expr_ops_byteorder = {
.get = nftnl_expr_byteorder_get,
.parse = nftnl_expr_byteorder_parse,
.build = nftnl_expr_byteorder_build,
- .snprintf = nftnl_expr_byteorder_snprintf,
+ .snprintf_ = nftnl_expr_byteorder_snprintf,
.json_parse = nftnl_expr_byteorder_json_parse,
};
diff --git a/src/expr/cmp.c b/src/expr/cmp.c
index 353e907..99b497c 100644
--- a/src/expr/cmp.c
+++ b/src/expr/cmp.c
@@ -284,6 +284,6 @@ struct expr_ops expr_ops_cmp = {
.get = nftnl_expr_cmp_get,
.parse = nftnl_expr_cmp_parse,
.build = nftnl_expr_cmp_build,
- .snprintf = nftnl_expr_cmp_snprintf,
+ .snprintf_ = nftnl_expr_cmp_snprintf,
.json_parse = nftnl_expr_cmp_json_parse,
};
diff --git a/src/expr/counter.c b/src/expr/counter.c
index 21901e8..9fd7655 100644
--- a/src/expr/counter.c
+++ b/src/expr/counter.c
@@ -200,6 +200,6 @@ struct expr_ops expr_ops_counter = {
.get = nftnl_expr_counter_get,
.parse = nftnl_expr_counter_parse,
.build = nftnl_expr_counter_build,
- .snprintf = nftnl_expr_counter_snprintf,
+ .snprintf_ = nftnl_expr_counter_snprintf,
.json_parse = nftnl_expr_counter_json_parse,
};
diff --git a/src/expr/ct.c b/src/expr/ct.c
index cdd08e9..6ce5478 100644
--- a/src/expr/ct.c
+++ b/src/expr/ct.c
@@ -356,6 +356,6 @@ struct expr_ops expr_ops_ct = {
.get = nftnl_expr_ct_get,
.parse = nftnl_expr_ct_parse,
.build = nftnl_expr_ct_build,
- .snprintf = nftnl_expr_ct_snprintf,
+ .snprintf_ = nftnl_expr_ct_snprintf,
.json_parse = nftnl_expr_ct_json_parse,
};
diff --git a/src/expr/dup.c b/src/expr/dup.c
index 9aa332b..2f491d8 100644
--- a/src/expr/dup.c
+++ b/src/expr/dup.c
@@ -206,6 +206,6 @@ struct expr_ops expr_ops_dup = {
.get = nftnl_expr_dup_get,
.parse = nftnl_expr_dup_parse,
.build = nftnl_expr_dup_build,
- .snprintf = nftnl_expr_dup_snprintf,
+ .snprintf_ = nftnl_expr_dup_snprintf,
.json_parse = nftnl_expr_dup_json_parse,
};
diff --git a/src/expr/dynset.c b/src/expr/dynset.c
index f7b99ea..758f07c 100644
--- a/src/expr/dynset.c
+++ b/src/expr/dynset.c
@@ -368,6 +368,6 @@ struct expr_ops expr_ops_dynset = {
.get = nftnl_expr_dynset_get,
.parse = nftnl_expr_dynset_parse,
.build = nftnl_expr_dynset_build,
- .snprintf = nftnl_expr_dynset_snprintf,
+ .snprintf_ = nftnl_expr_dynset_snprintf,
.json_parse = nftnl_expr_dynset_json_parse,
};
diff --git a/src/expr/exthdr.c b/src/expr/exthdr.c
index d4f1665..a834782 100644
--- a/src/expr/exthdr.c
+++ b/src/expr/exthdr.c
@@ -356,6 +356,6 @@ struct expr_ops expr_ops_exthdr = {
.get = nftnl_expr_exthdr_get,
.parse = nftnl_expr_exthdr_parse,
.build = nftnl_expr_exthdr_build,
- .snprintf = nftnl_expr_exthdr_snprintf,
+ .snprintf_ = nftnl_expr_exthdr_snprintf,
.json_parse = nftnl_expr_exthdr_json_parse,
};
diff --git a/src/expr/fib.c b/src/expr/fib.c
index f3be081..3c353b2 100644
--- a/src/expr/fib.c
+++ b/src/expr/fib.c
@@ -272,6 +272,6 @@ struct expr_ops expr_ops_fib = {
.get = nftnl_expr_fib_get,
.parse = nftnl_expr_fib_parse,
.build = nftnl_expr_fib_build,
- .snprintf = nftnl_expr_fib_snprintf,
+ .snprintf_ = nftnl_expr_fib_snprintf,
.json_parse = nftnl_expr_fib_json_parse,
};
diff --git a/src/expr/fwd.c b/src/expr/fwd.c
index c30d494..f6e41f1 100644
--- a/src/expr/fwd.c
+++ b/src/expr/fwd.c
@@ -180,6 +180,6 @@ struct expr_ops expr_ops_fwd = {
.get = nftnl_expr_fwd_get,
.parse = nftnl_expr_fwd_parse,
.build = nftnl_expr_fwd_build,
- .snprintf = nftnl_expr_fwd_snprintf,
+ .snprintf_ = nftnl_expr_fwd_snprintf,
.json_parse = nftnl_expr_fwd_json_parse,
};
diff --git a/src/expr/hash.c b/src/expr/hash.c
index d870510..5acb66a 100644
--- a/src/expr/hash.c
+++ b/src/expr/hash.c
@@ -332,6 +332,6 @@ struct expr_ops expr_ops_hash = {
.get = nftnl_expr_hash_get,
.parse = nftnl_expr_hash_parse,
.build = nftnl_expr_hash_build,
- .snprintf = nftnl_expr_hash_snprintf,
+ .snprintf_ = nftnl_expr_hash_snprintf,
.json_parse = nftnl_expr_hash_json_parse,
};
diff --git a/src/expr/immediate.c b/src/expr/immediate.c
index 0b188cc..94bd6da 100644
--- a/src/expr/immediate.c
+++ b/src/expr/immediate.c
@@ -316,6 +316,6 @@ struct expr_ops expr_ops_immediate = {
.get = nftnl_expr_immediate_get,
.parse = nftnl_expr_immediate_parse,
.build = nftnl_expr_immediate_build,
- .snprintf = nftnl_expr_immediate_snprintf,
+ .snprintf_ = nftnl_expr_immediate_snprintf,
.json_parse = nftnl_expr_immediate_json_parse,
};
diff --git a/src/expr/limit.c b/src/expr/limit.c
index 856ab18..e71fc2f 100644
--- a/src/expr/limit.c
+++ b/src/expr/limit.c
@@ -285,6 +285,6 @@ struct expr_ops expr_ops_limit = {
.get = nftnl_expr_limit_get,
.parse = nftnl_expr_limit_parse,
.build = nftnl_expr_limit_build,
- .snprintf = nftnl_expr_limit_snprintf,
+ .snprintf_ = nftnl_expr_limit_snprintf,
.json_parse = nftnl_expr_limit_json_parse,
};
diff --git a/src/expr/log.c b/src/expr/log.c
index b642255..71dd83a 100644
--- a/src/expr/log.c
+++ b/src/expr/log.c
@@ -352,6 +352,6 @@ struct expr_ops expr_ops_log = {
.get = nftnl_expr_log_get,
.parse = nftnl_expr_log_parse,
.build = nftnl_expr_log_build,
- .snprintf = nftnl_expr_log_snprintf,
+ .snprintf_ = nftnl_expr_log_snprintf,
.json_parse = nftnl_expr_log_json_parse,
};
diff --git a/src/expr/lookup.c b/src/expr/lookup.c
index 861815f..6049913 100644
--- a/src/expr/lookup.c
+++ b/src/expr/lookup.c
@@ -293,6 +293,6 @@ struct expr_ops expr_ops_lookup = {
.get = nftnl_expr_lookup_get,
.parse = nftnl_expr_lookup_parse,
.build = nftnl_expr_lookup_build,
- .snprintf = nftnl_expr_lookup_snprintf,
+ .snprintf_ = nftnl_expr_lookup_snprintf,
.json_parse = nftnl_expr_lookup_json_parse,
};
diff --git a/src/expr/masq.c b/src/expr/masq.c
index 7c235d3..adec325 100644
--- a/src/expr/masq.c
+++ b/src/expr/masq.c
@@ -228,6 +228,6 @@ struct expr_ops expr_ops_masq = {
.get = nftnl_expr_masq_get,
.parse = nftnl_expr_masq_parse,
.build = nftnl_expr_masq_build,
- .snprintf = nftnl_expr_masq_snprintf,
+ .snprintf_ = nftnl_expr_masq_snprintf,
.json_parse = nftnl_expr_masq_json_parse,
};
diff --git a/src/expr/match.c b/src/expr/match.c
index dd09e1e..f0d8868 100644
--- a/src/expr/match.c
+++ b/src/expr/match.c
@@ -249,6 +249,6 @@ struct expr_ops expr_ops_match = {
.get = nftnl_expr_match_get,
.parse = nftnl_expr_match_parse,
.build = nftnl_expr_match_build,
- .snprintf = nftnl_expr_match_snprintf,
+ .snprintf_ = nftnl_expr_match_snprintf,
.json_parse = nftnl_expr_match_json_parse,
};
diff --git a/src/expr/meta.c b/src/expr/meta.c
index 2c75841..907a677 100644
--- a/src/expr/meta.c
+++ b/src/expr/meta.c
@@ -290,6 +290,6 @@ struct expr_ops expr_ops_meta = {
.get = nftnl_expr_meta_get,
.parse = nftnl_expr_meta_parse,
.build = nftnl_expr_meta_build,
- .snprintf = nftnl_expr_meta_snprintf,
+ .snprintf_ = nftnl_expr_meta_snprintf,
.json_parse = nftnl_expr_meta_json_parse,
};
diff --git a/src/expr/nat.c b/src/expr/nat.c
index 29bc3a2..d476283 100644
--- a/src/expr/nat.c
+++ b/src/expr/nat.c
@@ -383,6 +383,6 @@ struct expr_ops expr_ops_nat = {
.get = nftnl_expr_nat_get,
.parse = nftnl_expr_nat_parse,
.build = nftnl_expr_nat_build,
- .snprintf = nftnl_expr_nat_snprintf,
+ .snprintf_ = nftnl_expr_nat_snprintf,
.json_parse = nftnl_expr_nat_json_parse,
};
diff --git a/src/expr/numgen.c b/src/expr/numgen.c
index a15f03a..28ef741 100644
--- a/src/expr/numgen.c
+++ b/src/expr/numgen.c
@@ -264,6 +264,6 @@ struct expr_ops expr_ops_ng = {
.get = nftnl_expr_ng_get,
.parse = nftnl_expr_ng_parse,
.build = nftnl_expr_ng_build,
- .snprintf = nftnl_expr_ng_snprintf,
+ .snprintf_ = nftnl_expr_ng_snprintf,
.json_parse = nftnl_expr_ng_json_parse,
};
diff --git a/src/expr/objref.c b/src/expr/objref.c
index 4cfa3cb..c394290 100644
--- a/src/expr/objref.c
+++ b/src/expr/objref.c
@@ -278,6 +278,6 @@ struct expr_ops expr_ops_objref = {
.get = nftnl_expr_objref_get,
.parse = nftnl_expr_objref_parse,
.build = nftnl_expr_objref_build,
- .snprintf = nftnl_expr_objref_snprintf,
+ .snprintf_ = nftnl_expr_objref_snprintf,
.json_parse = nftnl_expr_objref_json_parse,
};
diff --git a/src/expr/payload.c b/src/expr/payload.c
index 91e1587..894ac08 100644
--- a/src/expr/payload.c
+++ b/src/expr/payload.c
@@ -348,6 +348,6 @@ struct expr_ops expr_ops_payload = {
.get = nftnl_expr_payload_get,
.parse = nftnl_expr_payload_parse,
.build = nftnl_expr_payload_build,
- .snprintf = nftnl_expr_payload_snprintf,
+ .snprintf_ = nftnl_expr_payload_snprintf,
.json_parse = nftnl_expr_payload_json_parse,
};
diff --git a/src/expr/queue.c b/src/expr/queue.c
index 8a9deda..389af83 100644
--- a/src/expr/queue.c
+++ b/src/expr/queue.c
@@ -276,6 +276,6 @@ struct expr_ops expr_ops_queue = {
.get = nftnl_expr_queue_get,
.parse = nftnl_expr_queue_parse,
.build = nftnl_expr_queue_build,
- .snprintf = nftnl_expr_queue_snprintf,
+ .snprintf_ = nftnl_expr_queue_snprintf,
.json_parse = nftnl_expr_queue_json_parse,
};
diff --git a/src/expr/quota.c b/src/expr/quota.c
index 667e6e1..ff5d182 100644
--- a/src/expr/quota.c
+++ b/src/expr/quota.c
@@ -203,6 +203,6 @@ struct expr_ops expr_ops_quota = {
.get = nftnl_expr_quota_get,
.parse = nftnl_expr_quota_parse,
.build = nftnl_expr_quota_build,
- .snprintf = nftnl_expr_quota_snprintf,
+ .snprintf_ = nftnl_expr_quota_snprintf,
.json_parse = nftnl_expr_quota_json_parse,
};
diff --git a/src/expr/range.c b/src/expr/range.c
index 8c8ce12..34d422b 100644
--- a/src/expr/range.c
+++ b/src/expr/range.c
@@ -283,6 +283,6 @@ struct expr_ops expr_ops_range = {
.get = nftnl_expr_range_get,
.parse = nftnl_expr_range_parse,
.build = nftnl_expr_range_build,
- .snprintf = nftnl_expr_range_snprintf,
+ .snprintf_ = nftnl_expr_range_snprintf,
.json_parse = nftnl_expr_range_json_parse,
};
diff --git a/src/expr/redir.c b/src/expr/redir.c
index 43538d5..8a21f93 100644
--- a/src/expr/redir.c
+++ b/src/expr/redir.c
@@ -242,6 +242,6 @@ struct expr_ops expr_ops_redir = {
.get = nftnl_expr_redir_get,
.parse = nftnl_expr_redir_parse,
.build = nftnl_expr_redir_build,
- .snprintf = nftnl_expr_redir_snprintf,
+ .snprintf_ = nftnl_expr_redir_snprintf,
.json_parse = nftnl_expr_redir_json_parse,
};
diff --git a/src/expr/reject.c b/src/expr/reject.c
index 11d8b20..b10e729 100644
--- a/src/expr/reject.c
+++ b/src/expr/reject.c
@@ -200,6 +200,6 @@ struct expr_ops expr_ops_reject = {
.get = nftnl_expr_reject_get,
.parse = nftnl_expr_reject_parse,
.build = nftnl_expr_reject_build,
- .snprintf = nftnl_expr_reject_snprintf,
+ .snprintf_ = nftnl_expr_reject_snprintf,
.json_parse = nftnl_expr_reject_json_parse,
};
diff --git a/src/expr/rt.c b/src/expr/rt.c
index 5088e66..9f44b29 100644
--- a/src/expr/rt.c
+++ b/src/expr/rt.c
@@ -238,6 +238,6 @@ struct expr_ops expr_ops_rt = {
.get = nftnl_expr_rt_get,
.parse = nftnl_expr_rt_parse,
.build = nftnl_expr_rt_build,
- .snprintf = nftnl_expr_rt_snprintf,
+ .snprintf_ = nftnl_expr_rt_snprintf,
.json_parse = nftnl_expr_rt_json_parse,
};
diff --git a/src/expr/target.c b/src/expr/target.c
index ed4bf7d..2ef4078 100644
--- a/src/expr/target.c
+++ b/src/expr/target.c
@@ -249,6 +249,6 @@ struct expr_ops expr_ops_target = {
.get = nftnl_expr_target_get,
.parse = nftnl_expr_target_parse,
.build = nftnl_expr_target_build,
- .snprintf = nftnl_expr_target_snprintf,
+ .snprintf_ = nftnl_expr_target_snprintf,
.json_parse = nftnl_expr_target_json_parse,
};
diff --git a/src/obj/counter.c b/src/obj/counter.c
index beadc93..8c4cc25 100644
--- a/src/obj/counter.c
+++ b/src/obj/counter.c
@@ -179,6 +179,6 @@ struct obj_ops obj_ops_counter = {
.get = nftnl_obj_counter_get,
.parse = nftnl_obj_counter_parse,
.build = nftnl_obj_counter_build,
- .snprintf = nftnl_obj_counter_snprintf,
+ .snprintf_ = nftnl_obj_counter_snprintf,
.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
--- a/src/obj/ct_helper.c
+++ b/src/obj/ct_helper.c
@@ -205,6 +205,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,
- .snprintf = nftnl_obj_ct_helper_snprintf,
+ .snprintf_ = nftnl_obj_ct_helper_snprintf,
.json_parse = nftnl_obj_quota_json_parse,
};
diff --git a/src/obj/quota.c b/src/obj/quota.c
index d5757b2..e959ff8 100644
--- a/src/obj/quota.c
+++ b/src/obj/quota.c
@@ -200,6 +200,6 @@ struct obj_ops obj_ops_quota = {
.get = nftnl_obj_quota_get,
.parse = nftnl_obj_quota_parse,
.build = nftnl_obj_quota_build,
- .snprintf = nftnl_obj_quota_snprintf,
+ .snprintf_ = nftnl_obj_quota_snprintf,
.json_parse = nftnl_obj_quota_json_parse,
};
diff --git a/src/object.c b/src/object.c
index d409c6d..b938c97 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);
if (obj->ops)
- ret = obj->ops->snprintf(buf + b.len, size - b.len, type,
+ ret = obj->ops->snprintf_(buf + b.len, size - b.len, type,
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);
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 = snprintf(buf + offset, offset, "]");
--
2.12.2

View File

@ -0,0 +1,224 @@
Taken from
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755956
--- ./src/expr_ops.h 2014-06-24 17:07:05.574784704 +0400
+++ ../libnftnl-1.0.2-my/./src/expr_ops.h 2014-07-25 00:19:28.367694613 +0400
@@ -28,7 +28,7 @@
const void *(*get)(const struct nft_rule_expr *e, uint16_t type, uint32_t *data_len);
int (*parse)(struct nft_rule_expr *e, struct nlattr *attr);
void (*build)(struct nlmsghdr *nlh, struct nft_rule_expr *e);
- int (*snprintf)(char *buf, size_t len, uint32_t type, uint32_t flags, struct nft_rule_expr *e);
+ int (*snprintf_)(char *buf, size_t len, uint32_t type, uint32_t flags, struct nft_rule_expr *e);
int (*xml_parse)(struct nft_rule_expr *e, mxml_node_t *tree,
struct nft_parse_err *err);
int (*json_parse)(struct nft_rule_expr *e, json_t *data,
--- ./src/rule.c 2014-06-24 17:07:05.574784704 +0400
+++ ../libnftnl-1.0.2-my/./src/rule.c 2014-07-25 00:19:28.355694880 +0400
@@ -813,7 +813,7 @@
"{\"type\":\"%s\",", expr->ops->name);
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
- 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);
/*
--- ./src/expr.c 2014-06-24 17:07:05.574784704 +0400
+++ ../libnftnl-1.0.2-my/./src/expr.c 2014-07-25 00:19:27.367716863 +0400
@@ -227,7 +227,7 @@
int ret;
unsigned int offset = 0, len = size;
- 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);
return offset;
--- ./src/expr/exthdr.c 2014-06-25 18:34:08.174284719 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/exthdr.c 2014-07-25 00:21:48.192583628 +0400
@@ -362,7 +362,7 @@
.get = nft_rule_expr_exthdr_get,
.parse = nft_rule_expr_exthdr_parse,
.build = nft_rule_expr_exthdr_build,
- .snprintf = nft_rule_expr_exthdr_snprintf,
+ .snprintf_ = nft_rule_expr_exthdr_snprintf,
.xml_parse = nft_rule_expr_exthdr_xml_parse,
.json_parse = nft_rule_expr_exthdr_json_parse,
};
--- ./src/expr/log.c 2014-06-25 18:34:08.178284810 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/log.c 2014-07-25 00:21:48.160584340 +0400
@@ -332,7 +332,7 @@
.get = nft_rule_expr_log_get,
.parse = nft_rule_expr_log_parse,
.build = nft_rule_expr_log_build,
- .snprintf = nft_rule_expr_log_snprintf,
+ .snprintf_ = nft_rule_expr_log_snprintf,
.xml_parse = nft_rule_expr_log_xml_parse,
.json_parse = nft_rule_expr_log_json_parse,
};
--- ./src/expr/limit.c 2014-06-25 18:34:08.178284810 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/limit.c 2014-07-25 00:21:48.108585496 +0400
@@ -250,7 +250,7 @@
.get = nft_rule_expr_limit_get,
.parse = nft_rule_expr_limit_parse,
.build = nft_rule_expr_limit_build,
- .snprintf = nft_rule_expr_limit_snprintf,
+ .snprintf_ = nft_rule_expr_limit_snprintf,
.xml_parse = nft_rule_expr_limit_xml_parse,
.json_parse = nft_rule_expr_limit_json_parse,
};
--- ./src/expr/cmp.c 2014-06-25 18:34:08.174284719 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/cmp.c 2014-07-25 00:21:48.172584073 +0400
@@ -331,7 +331,7 @@
.get = nft_rule_expr_cmp_get,
.parse = nft_rule_expr_cmp_parse,
.build = nft_rule_expr_cmp_build,
- .snprintf = nft_rule_expr_cmp_snprintf,
+ .snprintf_ = nft_rule_expr_cmp_snprintf,
.xml_parse = nft_rule_expr_cmp_xml_parse,
.json_parse = nft_rule_expr_cmp_json_parse,
};
--- ./src/expr/target.c 2014-06-25 18:34:08.182284901 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/target.c 2014-07-25 00:21:48.184583806 +0400
@@ -274,7 +274,7 @@
.get = nft_rule_expr_target_get,
.parse = nft_rule_expr_target_parse,
.build = nft_rule_expr_target_build,
- .snprintf = nft_rule_expr_target_snprintf,
+ .snprintf_ = nft_rule_expr_target_snprintf,
.xml_parse = nft_rule_expr_target_xml_parse,
.json_parse = nft_rule_expr_target_json_parse,
};
--- ./src/expr/byteorder.c 2014-06-25 18:34:08.158284356 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/byteorder.c 2014-07-25 00:21:48.148584607 +0400
@@ -384,7 +384,7 @@
.get = nft_rule_expr_byteorder_get,
.parse = nft_rule_expr_byteorder_parse,
.build = nft_rule_expr_byteorder_build,
- .snprintf = nft_rule_expr_byteorder_snprintf,
+ .snprintf_ = nft_rule_expr_byteorder_snprintf,
.xml_parse = nft_rule_expr_byteorder_xml_parse,
.json_parse = nft_rule_expr_byteorder_json_parse,
};
--- ./src/expr/lookup.c 2014-06-25 18:34:08.178284810 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/lookup.c 2014-07-25 00:21:48.136584874 +0400
@@ -305,7 +305,7 @@
.get = nft_rule_expr_lookup_get,
.parse = nft_rule_expr_lookup_parse,
.build = nft_rule_expr_lookup_build,
- .snprintf = nft_rule_expr_lookup_snprintf,
+ .snprintf_ = nft_rule_expr_lookup_snprintf,
.xml_parse = nft_rule_expr_lookup_xml_parse,
.json_parse = nft_rule_expr_lookup_json_parse,
};
--- ./src/expr/immediate.c 2014-06-25 18:34:08.178284810 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/immediate.c 2014-07-25 00:21:48.124585141 +0400
@@ -365,7 +365,7 @@
.get = nft_rule_expr_immediate_get,
.parse = nft_rule_expr_immediate_parse,
.build = nft_rule_expr_immediate_build,
- .snprintf = nft_rule_expr_immediate_snprintf,
+ .snprintf_ = nft_rule_expr_immediate_snprintf,
.xml_parse = nft_rule_expr_immediate_xml_parse,
.json_parse = nft_rule_expr_immediate_json_parse,
};
--- ./src/expr/meta.c 2014-06-25 18:34:08.178284810 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/meta.c 2014-07-25 00:21:48.040587008 +0400
@@ -340,7 +340,7 @@
.get = nft_rule_expr_meta_get,
.parse = nft_rule_expr_meta_parse,
.build = nft_rule_expr_meta_build,
- .snprintf = nft_rule_expr_meta_snprintf,
+ .snprintf_ = nft_rule_expr_meta_snprintf,
.xml_parse = nft_rule_expr_meta_xml_parse,
.json_parse = nft_rule_expr_meta_json_parse,
};
--- ./src/expr/queue.c 2014-06-25 18:34:08.182284901 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/queue.c 2014-07-25 00:21:48.208583272 +0400
@@ -294,7 +294,7 @@
.get = nft_rule_expr_queue_get,
.parse = nft_rule_expr_queue_parse,
.build = nft_rule_expr_queue_build,
- .snprintf = nft_rule_expr_queue_snprintf,
+ .snprintf_ = nft_rule_expr_queue_snprintf,
.xml_parse = nft_rule_expr_queue_xml_parse,
.json_parse = nft_rule_expr_queue_json_parse,
};
--- ./src/expr/nat.c 2014-06-25 18:34:08.182284901 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/nat.c 2014-07-25 00:21:48.084586030 +0400
@@ -430,7 +430,7 @@
.get = nft_rule_expr_nat_get,
.parse = nft_rule_expr_nat_parse,
.build = nft_rule_expr_nat_build,
- .snprintf = nft_rule_expr_nat_snprintf,
+ .snprintf_ = nft_rule_expr_nat_snprintf,
.xml_parse = nft_rule_expr_nat_xml_parse,
.json_parse = nft_rule_expr_nat_json_parse,
};
--- ./src/expr/payload.c 2014-06-25 18:34:08.182284901 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/payload.c 2014-07-25 00:21:48.200583450 +0400
@@ -337,7 +337,7 @@
.get = nft_rule_expr_payload_get,
.parse = nft_rule_expr_payload_parse,
.build = nft_rule_expr_payload_build,
- .snprintf = nft_rule_expr_payload_snprintf,
+ .snprintf_ = nft_rule_expr_payload_snprintf,
.xml_parse = nft_rule_expr_payload_xml_parse,
.json_parse = nft_rule_expr_payload_json_parse,
};
--- ./src/expr/reject.c 2014-06-25 18:34:08.182284901 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/reject.c 2014-07-25 00:21:48.096585762 +0400
@@ -242,7 +242,7 @@
.get = nft_rule_expr_reject_get,
.parse = nft_rule_expr_reject_parse,
.build = nft_rule_expr_reject_build,
- .snprintf = nft_rule_expr_reject_snprintf,
+ .snprintf_ = nft_rule_expr_reject_snprintf,
.xml_parse = nft_rule_expr_reject_xml_parse,
.json_parse = nft_rule_expr_reject_json_parse,
};
--- ./src/expr/counter.c 2014-06-25 18:34:08.174284719 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/counter.c 2014-07-25 00:21:48.056586652 +0400
@@ -236,7 +236,7 @@
.get = nft_rule_expr_counter_get,
.parse = nft_rule_expr_counter_parse,
.build = nft_rule_expr_counter_build,
- .snprintf = nft_rule_expr_counter_snprintf,
+ .snprintf_ = nft_rule_expr_counter_snprintf,
.xml_parse = nft_rule_expr_counter_xml_parse,
.json_parse = nft_rule_expr_counter_json_parse,
};
--- ./src/expr/ct.c 2014-06-25 18:34:08.174284719 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/ct.c 2014-07-25 00:21:48.068586385 +0400
@@ -428,7 +428,7 @@
.get = nft_rule_expr_ct_get,
.parse = nft_rule_expr_ct_parse,
.build = nft_rule_expr_ct_build,
- .snprintf = nft_rule_expr_ct_snprintf,
+ .snprintf_ = nft_rule_expr_ct_snprintf,
.xml_parse = nft_rule_expr_ct_xml_parse,
.json_parse = nft_rule_expr_ct_json_parse,
};
--- ./src/expr/bitwise.c 2014-06-25 18:34:08.158284356 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/bitwise.c 2014-07-25 00:21:49.272559599 +0400
@@ -403,7 +403,7 @@
.get = nft_rule_expr_bitwise_get,
.parse = nft_rule_expr_bitwise_parse,
.build = nft_rule_expr_bitwise_build,
- .snprintf = nft_rule_expr_bitwise_snprintf,
+ .snprintf_ = nft_rule_expr_bitwise_snprintf,
.xml_parse = nft_rule_expr_bitwise_xml_parse,
.json_parse = nft_rule_expr_bitwise_json_parse,
};
--- ./src/expr/match.c 2014-06-25 18:34:08.178284810 +0400
+++ ../libnftnl-1.0.2-my/./src/expr/match.c 2014-07-25 00:21:48.032587186 +0400
@@ -273,7 +273,7 @@
.get = nft_rule_expr_match_get,
.parse = nft_rule_expr_match_parse,
.build = nft_rule_expr_match_build,
- .snprintf = nft_rule_expr_match_snprintf,
+ .snprintf_ = nft_rule_expr_match_snprintf,
.xml_parse = nft_rule_expr_match_xml_parse,
.json_parse = nft_rule_expr_match_json_parse,
};

View File

@ -1,13 +0,0 @@
SUMMARY = "Library for low-level interaction with nftables Netlink's API over libmnl"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=79808397c3355f163c012616125c9e26"
SECTION = "libs"
DEPENDS = "libmnl"
SRC_URI = "http://netfilter.org/projects/libnftnl/files/${BP}.tar.bz2 \
"
SRC_URI[md5sum] = "6d7f9f161538ca7efd535dcc70caf964"
SRC_URI[sha256sum] = "ad3b932a39a1e567308e91b683b32239a5e1aea9b4582dfffe2288c3400ab07e"
inherit autotools pkgconfig

View File

@ -0,0 +1,17 @@
SUMMARY = "Library for low-level interaction with nftables Netlink's API over libmnl"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=79808397c3355f163c012616125c9e26"
SECTION = "libs"
DEPENDS = "libmnl"
PV .= "+git${SRCPV}"
SRCREV = "4b89c0cb0883f638ff1abbc2ff47c43cdc26aac5"
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 \
"
SRC_URI[md5sum] = "82183867168eb6644926c48b991b8aac"
SRC_URI[sha256sum] = "9bb66ecbc64b8508249402f0093829f44177770ad99f6042b86b3a467d963982"
S = "${WORKDIR}/git"
inherit autotools pkgconfig