[PATCH nft 2/5] src: payload: export and use payload_expr_cmp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



expr->ops is going away, so export payload cmp and use it directly.

Signed-off-by: Florian Westphal <fw@xxxxxxxxx>
---
 include/payload.h         | 2 ++
 src/netlink_delinearize.c | 2 +-
 src/payload.c             | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/payload.h b/include/payload.h
index 161c64aedf11..a914d23930e9 100644
--- a/include/payload.h
+++ b/include/payload.h
@@ -59,4 +59,6 @@ extern void payload_expr_expand(struct list_head *list, struct expr *expr,
 extern void payload_expr_complete(struct expr *expr,
 				  const struct proto_ctx *ctx);
 
+bool payload_expr_cmp(const struct expr *e1, const struct expr *e2);
+
 #endif /* NFTABLES_PAYLOAD_H */
diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c
index d492910c2f93..21c6858ab4a8 100644
--- a/src/netlink_delinearize.c
+++ b/src/netlink_delinearize.c
@@ -2371,7 +2371,7 @@ static void stmt_payload_binop_postprocess(struct rule_pp_ctx *ctx)
 		if (payload->ops->type != EXPR_PAYLOAD)
 			return;
 
-		if (!payload->ops->cmp(stmt->payload.expr, payload))
+		if (!payload_expr_cmp(stmt->payload.expr, payload))
 			return;
 
 		mask = binop->right;
diff --git a/src/payload.c b/src/payload.c
index f638b0c0848c..5fd2a07bf8a5 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -54,7 +54,7 @@ static void payload_expr_print(const struct expr *expr, struct output_ctx *octx)
 			  expr->payload.offset, expr->len);
 }
 
-static bool payload_expr_cmp(const struct expr *e1, const struct expr *e2)
+bool payload_expr_cmp(const struct expr *e1, const struct expr *e2)
 {
 	return e1->payload.desc   == e2->payload.desc &&
 	       e1->payload.tmpl   == e2->payload.tmpl &&
-- 
2.19.2




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux