Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Gustavo: update for version 1.0.7]
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
-[baruch: update for versions 1.0.9, 1.1.2]
+[baruch: update for versions 1.0.9, 1.1.2, 1.1.3]
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
include/utils.h | 2 +-
- src/chain.c | 36 ++++++++++++++++++------------------
+ src/chain.c | 38 +++++++++++++++++++-------------------
src/common.c | 2 +-
src/expr.c | 4 ++--
src/expr/data_reg.c | 2 +-
src/expr/lookup.c | 2 +-
src/expr/match.c | 6 +++---
src/expr/target.c | 6 +++---
- src/flowtable.c | 32 ++++++++++++++++----------------
+ src/flowtable.c | 34 +++++++++++++++++-----------------
src/gen.c | 2 +-
src/object.c | 14 +++++++-------
src/rule.c | 32 ++++++++++++++++----------------
src/trace.c | 14 +++++++-------
src/udata.c | 2 +-
src/utils.c | 2 +-
- 23 files changed, 121 insertions(+), 121 deletions(-)
+ 23 files changed, 123 insertions(+), 123 deletions(-)
diff --git a/include/utils.h b/include/utils.h
index 3cc659652fe2..820556715013 100644
#define div_round_up(n, d) (((n) + (d) - 1) / (d))
diff --git a/src/chain.c b/src/chain.c
-index 01d62c84f140..93e193955934 100644
+index 26f9b9d61053..06316a26b075 100644
--- a/src/chain.c
+++ b/src/chain.c
-@@ -97,14 +97,14 @@ EXPORT_SYMBOL(nftnl_chain_free);
- void nftnl_chain_free(const struct nftnl_chain *c)
- {
+@@ -114,14 +114,14 @@ void nftnl_chain_free(const struct nftnl_chain *c)
+ nftnl_rule_free(r);
+
if (c->flags & (1 << NFTNL_CHAIN_NAME))
- xfree(c->name);
+ nftnl_xfree(c->name);
}
EXPORT_SYMBOL(nftnl_chain_is_set);
-@@ -121,15 +121,15 @@ void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
+@@ -138,15 +138,15 @@ void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
switch (attr) {
case NFTNL_CHAIN_NAME:
break;
case NFTNL_CHAIN_HOOKNUM:
case NFTNL_CHAIN_PRIO:
-@@ -140,7 +140,7 @@ void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
+@@ -157,7 +157,7 @@ void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
case NFTNL_CHAIN_FAMILY:
break;
case NFTNL_CHAIN_DEV:
break;
default:
return;
-@@ -169,7 +169,7 @@ int nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
+@@ -186,7 +186,7 @@ int nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
switch(attr) {
case NFTNL_CHAIN_NAME:
if (c->flags & (1 << NFTNL_CHAIN_NAME))
c->name = strdup(data);
if (!c->name)
-@@ -177,7 +177,7 @@ int nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
+@@ -194,7 +194,7 @@ int nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
break;
case NFTNL_CHAIN_TABLE:
if (c->flags & (1 << NFTNL_CHAIN_TABLE))
c->table = strdup(data);
if (!c->table)
-@@ -209,7 +209,7 @@ int nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
+@@ -226,7 +226,7 @@ int nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
break;
case NFTNL_CHAIN_TYPE:
if (c->flags & (1 << NFTNL_CHAIN_TYPE))
c->type = strdup(data);
if (!c->type)
-@@ -217,7 +217,7 @@ int nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
+@@ -234,7 +234,7 @@ int nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
break;
case NFTNL_CHAIN_DEV:
if (c->flags & (1 << NFTNL_CHAIN_DEV))
c->dev = strdup(data);
if (!c->dev)
-@@ -541,7 +541,7 @@ int nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
+@@ -588,7 +588,7 @@ int nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
if (tb[NFTA_CHAIN_NAME]) {
if (c->flags & (1 << NFTNL_CHAIN_NAME))
c->name = strdup(mnl_attr_get_str(tb[NFTA_CHAIN_NAME]));
if (!c->name)
return -1;
-@@ -549,7 +549,7 @@ int nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
+@@ -596,7 +596,7 @@ int nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
}
if (tb[NFTA_CHAIN_TABLE]) {
if (c->flags & (1 << NFTNL_CHAIN_TABLE))
c->table = strdup(mnl_attr_get_str(tb[NFTA_CHAIN_TABLE]));
if (!c->table)
return -1;
-@@ -579,7 +579,7 @@ int nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
+@@ -626,7 +626,7 @@ int nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
}
if (tb[NFTA_CHAIN_TYPE]) {
if (c->flags & (1 << NFTNL_CHAIN_TYPE))
c->type = strdup(mnl_attr_get_str(tb[NFTA_CHAIN_TYPE]));
if (!c->type)
return -1;
-@@ -711,7 +711,7 @@ void nftnl_chain_list_free(struct nftnl_chain_list *list)
- list_del(&r->head);
+@@ -810,7 +810,7 @@ struct nftnl_rule *nftnl_rule_iter_next(struct nftnl_rule_iter *iter)
+ EXPORT_SYMBOL(nftnl_rule_iter_destroy);
+ void nftnl_rule_iter_destroy(struct nftnl_rule_iter *iter)
+ {
+- xfree(iter);
++ nftnl_xfree(iter);
+ }
+
+ #define CHAIN_NAME_HSIZE 512
+@@ -848,7 +848,7 @@ void nftnl_chain_list_free(struct nftnl_chain_list *list)
+ hlist_del(&r->hnode);
nftnl_chain_free(r);
}
- xfree(list);
}
EXPORT_SYMBOL(nftnl_chain_list_is_empty);
-@@ -797,5 +797,5 @@ struct nftnl_chain *nftnl_chain_list_iter_next(struct nftnl_chain_list_iter *ite
+@@ -967,5 +967,5 @@ struct nftnl_chain *nftnl_chain_list_iter_next(struct nftnl_chain_list_iter *ite
EXPORT_SYMBOL(nftnl_chain_list_iter_destroy);
void nftnl_chain_list_iter_destroy(struct nftnl_chain_list_iter *iter)
{
struct expr_ops expr_ops_target = {
diff --git a/src/flowtable.c b/src/flowtable.c
-index c939306b56c4..f1b3eef48b73 100644
+index 1f7ba3052d4f..7f3f6bbcfd13 100644
--- a/src/flowtable.c
+++ b/src/flowtable.c
@@ -45,16 +45,16 @@ void nftnl_flowtable_free(const struct nftnl_flowtable *c)
@@ -86,8 +86,8 @@ void nftnl_flowtable_unset(struct nftnl_flowtable *c, uint16_t attr)
break;
case NFTNL_FLOWTABLE_DEVICES:
- for (i = 0; i < c->dev_array_len; i++) {
+ for (i = 0; i < c->dev_array_len; i++)
- xfree(c->dev_array[i]);
-- xfree(c->dev_array);
+- xfree(c->dev_array);
+ nftnl_xfree(c->dev_array[i]);
-+ nftnl_xfree(c->dev_array);
- }
++ nftnl_xfree(c->dev_array);
break;
default:
-@@ -117,7 +117,7 @@ int nftnl_flowtable_set_data(struct nftnl_flowtable *c, uint16_t attr,
+ return;
+@@ -116,7 +116,7 @@ int nftnl_flowtable_set_data(struct nftnl_flowtable *c, uint16_t attr,
switch(attr) {
case NFTNL_FLOWTABLE_NAME:
if (c->flags & (1 << NFTNL_FLOWTABLE_NAME))
c->name = strdup(data);
if (!c->name)
-@@ -125,7 +125,7 @@ int nftnl_flowtable_set_data(struct nftnl_flowtable *c, uint16_t attr,
+@@ -124,7 +124,7 @@ int nftnl_flowtable_set_data(struct nftnl_flowtable *c, uint16_t attr,
break;
case NFTNL_FLOWTABLE_TABLE:
if (c->flags & (1 << NFTNL_FLOWTABLE_TABLE))
c->table = strdup(data);
if (!c->table)
-@@ -147,8 +147,8 @@ int nftnl_flowtable_set_data(struct nftnl_flowtable *c, uint16_t attr,
+@@ -146,8 +146,8 @@ int nftnl_flowtable_set_data(struct nftnl_flowtable *c, uint16_t attr,
if (c->flags & (1 << NFTNL_FLOWTABLE_DEVICES)) {
- for (i = 0; i < c->dev_array_len; i++) {
+ for (i = 0; i < c->dev_array_len; i++)
- xfree(c->dev_array[i]);
-- xfree(c->dev_array);
+- xfree(c->dev_array);
+ nftnl_xfree(c->dev_array[i]);
-+ nftnl_xfree(c->dev_array);
- }
++ nftnl_xfree(c->dev_array);
}
-@@ -423,7 +423,7 @@ int nftnl_flowtable_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_flowtab
+ c->dev_array = calloc(len + 1, sizeof(char *));
+@@ -385,7 +385,7 @@ static int nftnl_flowtable_parse_devs(struct nlattr *nest,
+ return 0;
+ err:
+ while (len--)
+- xfree(dev_array[len]);
++ nftnl_xfree(dev_array[len]);
+ return -1;
+ }
+
+@@ -426,7 +426,7 @@ int nftnl_flowtable_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_flowtab
if (tb[NFTA_FLOWTABLE_NAME]) {
if (c->flags & (1 << NFTNL_FLOWTABLE_NAME))
c->name = strdup(mnl_attr_get_str(tb[NFTA_FLOWTABLE_NAME]));
if (!c->name)
return -1;
-@@ -431,7 +431,7 @@ int nftnl_flowtable_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_flowtab
+@@ -434,7 +434,7 @@ int nftnl_flowtable_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_flowtab
}
if (tb[NFTA_FLOWTABLE_TABLE]) {
if (c->flags & (1 << NFTNL_FLOWTABLE_TABLE))
c->table = strdup(mnl_attr_get_str(tb[NFTA_FLOWTABLE_TABLE]));
if (!c->table)
return -1;
-@@ -635,7 +635,7 @@ void nftnl_flowtable_list_free(struct nftnl_flowtable_list *list)
+@@ -638,7 +638,7 @@ void nftnl_flowtable_list_free(struct nftnl_flowtable_list *list)
list_del(&s->head);
nftnl_flowtable_free(s);
}
EXPORT_SYMBOL(nftnl_gen_is_set);
diff --git a/src/object.c b/src/object.c
-index e88203a82441..28e04486c76c 100644
+index 5c8d1835ca97..1de1b35d2217 100644
--- a/src/object.c
+++ b/src/object.c
@@ -53,11 +53,11 @@ EXPORT_SYMBOL(nftnl_obj_free);
+ nftnl_xfree(iter);
}
diff --git a/src/rule.c b/src/rule.c
-index 9af8fae2a803..0fce46e5c944 100644
+index 8173fcdd863d..36446de29dbe 100644
--- a/src/rule.c
+++ b/src/rule.c
-@@ -75,13 +75,13 @@ void nftnl_rule_free(const struct nftnl_rule *r)
+@@ -53,13 +53,13 @@ void nftnl_rule_free(const struct nftnl_rule *r)
nftnl_expr_free(e);
if (r->flags & (1 << (NFTNL_RULE_TABLE)))
}
EXPORT_SYMBOL(nftnl_rule_is_set);
-@@ -98,10 +98,10 @@ void nftnl_rule_unset(struct nftnl_rule *r, uint16_t attr)
+@@ -76,10 +76,10 @@ void nftnl_rule_unset(struct nftnl_rule *r, uint16_t attr)
switch (attr) {
case NFTNL_RULE_TABLE:
break;
case NFTNL_RULE_HANDLE:
case NFTNL_RULE_COMPAT_PROTO:
-@@ -111,7 +111,7 @@ void nftnl_rule_unset(struct nftnl_rule *r, uint16_t attr)
- case NFTNL_RULE_ID:
+@@ -90,7 +90,7 @@ void nftnl_rule_unset(struct nftnl_rule *r, uint16_t attr)
+ case NFTNL_RULE_POSITION_ID:
break;
case NFTNL_RULE_USERDATA:
- xfree(r->user.data);
break;
}
-@@ -137,7 +137,7 @@ int nftnl_rule_set_data(struct nftnl_rule *r, uint16_t attr,
+@@ -117,7 +117,7 @@ int nftnl_rule_set_data(struct nftnl_rule *r, uint16_t attr,
switch(attr) {
case NFTNL_RULE_TABLE:
if (r->flags & (1 << NFTNL_RULE_TABLE))
r->table = strdup(data);
if (!r->table)
-@@ -145,7 +145,7 @@ int nftnl_rule_set_data(struct nftnl_rule *r, uint16_t attr,
+@@ -125,7 +125,7 @@ int nftnl_rule_set_data(struct nftnl_rule *r, uint16_t attr,
break;
case NFTNL_RULE_CHAIN:
if (r->flags & (1 << NFTNL_RULE_CHAIN))
r->chain = strdup(data);
if (!r->chain)
-@@ -168,7 +168,7 @@ int nftnl_rule_set_data(struct nftnl_rule *r, uint16_t attr,
+@@ -148,7 +148,7 @@ int nftnl_rule_set_data(struct nftnl_rule *r, uint16_t attr,
break;
case NFTNL_RULE_USERDATA:
if (r->flags & (1 << NFTNL_RULE_USERDATA))
r->user.data = malloc(data_len);
if (!r->user.data)
-@@ -453,7 +453,7 @@ int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
+@@ -442,7 +442,7 @@ int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
if (tb[NFTA_RULE_TABLE]) {
if (r->flags & (1 << NFTNL_RULE_TABLE))
r->table = strdup(mnl_attr_get_str(tb[NFTA_RULE_TABLE]));
if (!r->table)
return -1;
-@@ -461,7 +461,7 @@ int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
+@@ -450,7 +450,7 @@ int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
}
if (tb[NFTA_RULE_CHAIN]) {
if (r->flags & (1 << NFTNL_RULE_CHAIN))
r->chain = strdup(mnl_attr_get_str(tb[NFTA_RULE_CHAIN]));
if (!r->chain)
return -1;
-@@ -490,7 +490,7 @@ int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
+@@ -479,7 +479,7 @@ int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
mnl_attr_get_payload(tb[NFTA_RULE_USERDATA]);
if (r->flags & (1 << NFTNL_RULE_USERDATA))
r->user.len = mnl_attr_get_payload_len(tb[NFTA_RULE_USERDATA]);
-@@ -737,7 +737,7 @@ struct nftnl_expr *nftnl_expr_iter_next(struct nftnl_expr_iter *iter)
+@@ -735,7 +735,7 @@ struct nftnl_expr *nftnl_expr_iter_next(struct nftnl_expr_iter *iter)
EXPORT_SYMBOL(nftnl_expr_iter_destroy);
void nftnl_expr_iter_destroy(struct nftnl_expr_iter *iter)
{
}
struct nftnl_rule_list {
-@@ -767,7 +767,7 @@ void nftnl_rule_list_free(struct nftnl_rule_list *list)
+@@ -765,7 +765,7 @@ void nftnl_rule_list_free(struct nftnl_rule_list *list)
list_del(&r->head);
nftnl_rule_free(r);
}
}
EXPORT_SYMBOL(nftnl_rule_list_is_empty);
-@@ -865,5 +865,5 @@ struct nftnl_rule *nftnl_rule_list_iter_next(struct nftnl_rule_list_iter *iter)
+@@ -863,5 +863,5 @@ struct nftnl_rule *nftnl_rule_list_iter_next(struct nftnl_rule_list_iter *iter)
EXPORT_SYMBOL(nftnl_rule_list_iter_destroy);
void nftnl_rule_list_iter_destroy(const struct nftnl_rule_list_iter *iter)
{