Skip to contentSkip to conversation

src: fix compile error due to _UNTIL renamed to _MODULUS in libnftnl

PATCH Applied Liping Zhang 2 participants 2 messages Sep 12, 2016 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 src: fix compile error due to _UNTIL renamed to _MODULUS in libnftnl

From: Liping Zhang <[email protected]>

In the latest libnftnl, NFTNL_EXPR_NG_UNTIL was renamed to NFTNL_EXPR_NG_MODULUS, so compile error happened:
netlink_linearize.c: In function ‘netlink_gen_numgen’:
netlink_linearize.c:184:26: error: ‘NFTNL_EXPR_NG_UNTIL’ undeclared (first use in this function)

Also update NFTA_NG_UNTIL to NFTA_NG_MODULUS.

---
V2: update NFTA_NG_UNTIL to NFTA_NG_MODULUS reported by Laura Garcia Liebana.

 include/linux/netfilter/nf_tables.h | 4 ++--
 src/netlink_delinearize.c           | 2 +-
 src/netlink_linearize.c             | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
include/linux/netfilter/nf_tables.h +2 -2
index 8a63f22..1bec149 100644
@@ -1126,13 +1126,13 @@ enum nft_trace_types {
  * enum nft_ng_attributes - nf_tables number generator expression netlink attributes
  *
  * @NFTA_NG_DREG: destination register (NLA_U32)
- * @NFTA_NG_UNTIL: source value to increment the counter until reset (NLA_U32)
+ * @NFTA_NG_MODULUS: maximum counter value (NLA_U32)
  * @NFTA_NG_TYPE: operation type (NLA_U32)
  */
 enum nft_ng_attributes {
 	NFTA_NG_UNSPEC,
 	NFTA_NG_DREG,
-	NFTA_NG_UNTIL,
+	NFTA_NG_MODULUS,
 	NFTA_NG_TYPE,
 	__NFTA_NG_MAX
 };
src/netlink_delinearize.c +1 -1
index 05edb01..6bb27b6 100644
@@ -554,7 +554,7 @@ static void netlink_parse_numgen(struct netlink_parse_ctx *ctx,
 	struct expr *expr;
 
 	type  = nftnl_expr_get_u32(nle, NFTNL_EXPR_NG_TYPE);
-	until = nftnl_expr_get_u32(nle, NFTNL_EXPR_NG_UNTIL);
+	until = nftnl_expr_get_u32(nle, NFTNL_EXPR_NG_MODULUS);
 
 	expr = numgen_expr_alloc(loc, type, until);
 	dreg = netlink_parse_register(nle, NFTNL_EXPR_NG_DREG);
src/netlink_linearize.c +1 -1
index 5204154..558deb2 100644
@@ -181,7 +181,7 @@ static void netlink_gen_numgen(struct netlink_linearize_ctx *ctx,
 	nle = alloc_nft_expr("numgen");
 	netlink_put_register(nle, NFTNL_EXPR_NG_DREG, dreg);
 	netlink_put_register(nle, NFTNL_EXPR_NG_TYPE, expr->numgen.type);
-	nftnl_expr_set_u32(nle, NFTNL_EXPR_NG_UNTIL, expr->numgen.mod);
+	nftnl_expr_set_u32(nle, NFTNL_EXPR_NG_MODULUS, expr->numgen.mod);
 	nftnl_rule_add_expr(ctx->nlr, nle);
 }
 
Signature · 1 line
2.5.5
maintainer Applied
#1 lore raw
Quoted 9 lines · Liping Zhang

From: Liping Zhang <[email protected]>

In the latest libnftnl, NFTNL_EXPR_NG_UNTIL was renamed to NFTNL_EXPR_NG_MODULUS, so compile error happened:
netlink_linearize.c: In function ‘netlink_gen_numgen’:
netlink_linearize.c:184:26: error: ‘NFTNL_EXPR_NG_UNTIL’ undeclared (first use in this function)

Also update NFTA_NG_UNTIL to NFTA_NG_MODULUS.

Applied, thanks.