netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] expr: allow export of notrack expr
@ 2019-08-02  4:20 Ivan Babrou
  2019-08-02  9:35 ` Florian Westphal
  0 siblings, 1 reply; 3+ messages in thread
From: Ivan Babrou @ 2019-08-02  4:20 UTC (permalink / raw)
  To: netfilter-devel

Currently it's impossible to export notrack expr as json,
as it lacks snprintf member and triggers segmentation fault.

There are no parameters to notrack, so there's nothing
to do, but it should be an explicit function that does nothing.

Signed-off-by: Ivan Babrou <ivan@cloudflare.com>
---
 src/expr_ops.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/expr_ops.c b/src/expr_ops.c
index 3538dd6..a2e1dd3 100644
--- a/src/expr_ops.c
+++ b/src/expr_ops.c
@@ -42,8 +42,16 @@ extern struct expr_ops expr_ops_tunnel;
 extern struct expr_ops expr_ops_osf;
 extern struct expr_ops expr_ops_xfrm;

+static int
+nftnl_expr_notrack_snprintf(char *buf, size_t len, uint32_t type,
+   uint32_t flags, const struct nftnl_expr *e)
+{
+ return -1;
+}
+
 static struct expr_ops expr_ops_notrack = {
  .name = "notrack",
+ .snprintf = nftnl_expr_notrack_snprintf,
 };

 static struct expr_ops *expr_ops[] = {
--
2.22.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-02 17:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-02  4:20 [PATCH] expr: allow export of notrack expr Ivan Babrou
2019-08-02  9:35 ` Florian Westphal
2019-08-02 17:39   ` Ivan Babrou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).