add ct expectation support
v4 cover add ct expectation support
This is the nft part of the modification to add conntrack expectation support. This is following the nf-next and libnftnl parts.
Stéphane Veyret (1):
add ct expectations support
doc/libnftables-json.adoc | 55 +++++++++++++++- doc/stateful-objects.txt | 49 +++++++++++++++ include/linux/netfilter/nf_tables.h | 14 ++++- include/rule.h | 10 +++ src/evaluate.c | 4 ++ src/json.c | 11 ++++ src/mnl.c | 13 ++++ src/netlink.c | 12 ++++ src/parser_bison.y | 62 ++++++++++++++++++- src/parser_json.c | 45 ++++++++++++++ src/rule.c | 35 +++++++++++ src/scanner.l | 1 + src/statement.c | 4 ++ tests/py/ip/objects.t | 9 +++ tests/py/ip/objects.t.payload | 4 ++ tests/py/nft-test.py | 4 ++ tests/shell/testcases/listing/0013objects_0 | 9 +++ .../testcases/nft-f/0018ct_expectation_obj_0 | 18 ++++++ 18 files changed, 354 insertions(+), 5 deletions(-) create mode 100755 tests/shell/testcases/nft-f/0018ct_expectation_obj_0
Signature · 1 line
2.21.0
PATCH v4 1/1 add ct expectations support
This modification allow to directly add/list/delete expectations.
--- doc/libnftables-json.adoc | 55 +++++++++++++++- doc/stateful-objects.txt | 49 +++++++++++++++ include/linux/netfilter/nf_tables.h | 14 ++++- include/rule.h | 10 +++ src/evaluate.c | 4 ++ src/json.c | 11 ++++ src/mnl.c | 13 ++++ src/netlink.c | 12 ++++ src/parser_bison.y | 62 ++++++++++++++++++- src/parser_json.c | 45 ++++++++++++++ src/rule.c | 35 +++++++++++ src/scanner.l | 1 + src/statement.c | 4 ++ tests/py/ip/objects.t | 9 +++ tests/py/ip/objects.t.payload | 4 ++ tests/py/nft-test.py | 4 ++ tests/shell/testcases/listing/0013objects_0 | 9 +++ .../testcases/nft-f/0018ct_expectation_obj_0 | 18 ++++++ 18 files changed, 354 insertions(+), 5 deletions(-) create mode 100755 tests/shell/testcases/nft-f/0018ct_expectation_obj_0
doc/libnftables-json.adoc +52 -3
@@ -23,7 +23,7 @@ libnftables-json - Supported JSON schema by libnftables 'LIST_OBJECT' := 'TABLE' | 'CHAIN' | 'RULE' | 'SET' | 'MAP' | 'ELEMENT' | 'FLOWTABLE' | 'COUNTER' | 'QUOTA' | 'CT_HELPER' | 'LIMIT' | - 'METAINFO_OBJECT' | 'CT_TIMEOUT' + 'METAINFO_OBJECT' | 'CT_TIMEOUT' | 'CT_EXPECTATION' == DESCRIPTION libnftables supports JSON formatted input and output. This is implemented as an
@@ -118,7 +118,7 @@ ____ 'ADD_OBJECT' := 'TABLE' | 'CHAIN' | 'RULE' | 'SET' | 'MAP' | 'ELEMENT' | 'FLOWTABLE' | 'COUNTER | QUOTA' | 'CT_HELPER' | 'LIMIT' | - 'CT_TIMEOUT' + 'CT_TIMEOUT' | 'CT_EXPECTATION' ____ Add a new ruleset element to the kernel.
@@ -162,7 +162,8 @@ ____ 'LIST_OBJECT' := 'TABLE' | 'TABLES' | 'CHAIN' | 'CHAINS' | 'SET' | 'SETS' | 'MAP' | 'MAPS | COUNTER' | 'COUNTERS' | 'QUOTA' | 'QUOTAS' | 'CT_HELPER' | 'CT_HELPERS' | 'LIMIT' | 'LIMITS | RULESET' | - 'METER' | 'METERS' | 'FLOWTABLES' | 'CT_TIMEOUT' + 'METER' | 'METERS' | 'FLOWTABLES' | 'CT_TIMEOUT' | + 'CT_EXPECTATION' ____ List ruleset elements. The plural forms are used to list all objects of that
@@ -597,6 +598,45 @@ This object represents a named conntrack timeout policy. *l3proto*:: The ct timeout object's layer 3 protocol, e.g. *"ip"* or *"ip6"*. +=== CT EXPECTATION +[verse] +____ +*{ "ct expectation": { + "family":* 'STRING'*, + "table":* 'STRING'*, + "name":* 'STRING'*, + "handle":* 'NUMBER'*, + "l3proto":* 'STRING' + "protocol":* 'CTH_PROTO'*, + "dport":* 'NUMBER'*, + "timeout:* 'NUMBER'*, + "size:* 'NUMBER'*, +*}}* + +'CTH_PROTO' := *"tcp"* | *"udp"* | *"dccp"* | *"sctp"* | *"gre"* | *"icmpv6"* | *"icmp"* | *"generic"* +____ + +This object represents a named conntrack expectation. + +*family*:: + The table's family. +*table*:: + The table's name. +*name*:: + The ct expectation object's name. +*handle*:: + The ct expectation object's handle. In input, it is used by *delete* command only. +*l3proto*:: + The ct expectation object's layer 3 protocol, e.g. *"ip"* or *"ip6"*. +*protocol*:: + The ct expectation object's layer 4 protocol. +*dport*:: + The destination port of the expected connection. +*timeout*:: + The time in millisecond that this expectation will live. +*size*:: + The maximum count of expectations to be living in the same time. + == STATEMENTS Statements are the building blocks for rules. Each rule consists of at least one.
@@ -1004,6 +1044,15 @@ Assign connection tracking timeout policy. *ct timeout*:: CT timeout reference. +=== CT EXPECTATION +[verse] +*{ "ct expectation":* 'EXPRESSION' *}* + +Assign connection tracking expectation. + +*ct expectation*:: + CT expectation reference. + === XT [verse] *{ "xt": null }*
doc/stateful-objects.txt +49 -0
55 lines not on this page · raw message
include/linux/netfilter/nf_tables.h +13 -1
@@ -1443,6 +1443,17 @@ enum nft_ct_timeout_timeout_attributes { };#define NFTA_CT_TIMEOUT_MAX (__NFTA_CT_TIMEOUT_MAX - 1) +enum nft_ct_expect_attributes { +NFTA_CT_EXPECT_UNSPEC , +NFTA_CT_EXPECT_L3PROTO , +NFTA_CT_EXPECT_L4PROTO , +NFTA_CT_EXPECT_DPORT , +NFTA_CT_EXPECT_TIMEOUT , +NFTA_CT_EXPECT_SIZE , + __NFTA_CT_EXPECT_MAX, +}; +#define NFTA_CT_EXPECT_MAX (__NFTA_CT_EXPECT_MAX - 1) +#define NFT_OBJECT_UNSPEC 0#define NFT_OBJECT_COUNTER 1#define NFT_OBJECT_QUOTA 2
@@ -1452,7 +1463,8 @@ enum nft_ct_timeout_timeout_attributes {#define NFT_OBJECT_TUNNEL 6#define NFT_OBJECT_CT_TIMEOUT 7#define NFT_OBJECT_SECMARK 8 -#define __NFT_OBJECT_MAX 9 +#define NFT_OBJECT_CT_EXPECT 9 +#define __NFT_OBJECT_MAX 10#define NFT_OBJECT_MAX (__NFT_OBJECT_MAX - 1)/**
include/rule.h +10 -0
@@ -351,6 +351,14 @@ struct ct_timeout {struct list_head timeout_list; }; +struct ct_expect { +uint16_t l3proto; +uint8_t l4proto; +uint16_t dport; +uint32_t timeout; +uint8_t size; +}; +struct limit {uint64_t rate;uint64_t unit;
@@ -385,6 +393,7 @@ struct obj {struct limit limit;struct ct_timeout ct_timeout;struct secmark secmark; +struct ct_expect ct_expect; }; };
@@ -519,6 +528,7 @@ enum cmd_obj {CMD_OBJ_CT_TIMEOUT ,CMD_OBJ_SECMARK ,CMD_OBJ_SECMARKS , + CMD_OBJ_CT_EXPECT, }; struct markup {
src/evaluate.c +4 -0
@@ -3452,6 +3452,7 @@ static int cmd_evaluate_add(struct eval_ctx *ctx, struct cmd *cmd)case CMD_OBJ_LIMIT :case CMD_OBJ_CT_TIMEOUT :case CMD_OBJ_SECMARK : +case CMD_OBJ_CT_EXPECT :return obj_evaluate (ctx, cmd->object);default :BUG ("invalid command object type %u\n" , cmd->obj);
@@ -3480,6 +3481,7 @@ static int cmd_evaluate_delete(struct eval_ctx *ctx, struct cmd *cmd)case CMD_OBJ_CT_TIMEOUT :case CMD_OBJ_LIMIT :case CMD_OBJ_SECMARK : +case CMD_OBJ_CT_EXPECT :return 0 ;default :BUG ("invalid command object type %u\n" , cmd->obj);
@@ -3623,6 +3625,8 @@ static int cmd_evaluate_list(struct eval_ctx *ctx, struct cmd *cmd)return cmd_evaluate_list_obj (ctx, cmd,NFT_OBJECT_LIMIT );case CMD_OBJ_SECMARK :return cmd_evaluate_list_obj (ctx, cmd,NFT_OBJECT_SECMARK ); +case CMD_OBJ_CT_EXPECT : +return cmd_evaluate_list_obj (ctx, cmd,NFT_OBJECT_CT_EXPECT );case CMD_OBJ_COUNTERS :case CMD_OBJ_QUOTAS :case CMD_OBJ_CT_HELPERS :
src/json.c +11 -0
@@ -325,6 +325,17 @@ static json_t *obj_print_json(const struct obj *obj)json_object_update (root, tmp);json_decref (tmp);break ; +case NFT_OBJECT_CT_EXPECT : + tmp =json_pack ("{s:o, s:I, s:I, s:s, s:I}" , +"protocol" , +proto_name_json (obj->ct_expect.l4proto), +"dport" , obj->ct_expect.dport, +"timeout" , obj->ct_expect.timeout, +"size" , obj->ct_expect.size, +"l3proto" ,family2str (obj->ct_expect.l3proto)); +json_object_update (root, tmp); +json_decref (tmp); +break ;case NFT_OBJECT_LIMIT : rate = obj->limit.rate; burst = obj->limit.burst;
src/mnl.c +13 -0
@@ -1000,6 +1000,19 @@ int mnl_nft_obj_add(struct netlink_ctx *ctx, const struct cmd *cmd,nftnl_obj_set (nlo,NFTNL_OBJ_CT_TIMEOUT_ARRAY , obj->ct_timeout.timeout);break ; +case NFT_OBJECT_CT_EXPECT : +if (obj->ct_expect.l3proto) +nftnl_obj_set_u16 (nlo,NFTNL_OBJ_CT_EXPECT_L3PROTO , + obj->ct_expect.l3proto); +nftnl_obj_set_u8 (nlo,NFTNL_OBJ_CT_EXPECT_L4PROTO , + obj->ct_expect.l4proto); +nftnl_obj_set_u16 (nlo,NFTNL_OBJ_CT_EXPECT_DPORT , + obj->ct_expect.dport); +nftnl_obj_set_u32 (nlo,NFTNL_OBJ_CT_EXPECT_TIMEOUT , + obj->ct_expect.timeout); +nftnl_obj_set_u8 (nlo,NFTNL_OBJ_CT_EXPECT_SIZE , + obj->ct_expect.size); +break ;case NFT_OBJECT_SECMARK :nftnl_obj_set_str (nlo,NFTNL_OBJ_SECMARK_CTX , obj->secmark.ctx);
src/netlink.c +12 -0
@@ -997,6 +997,18 @@ struct obj *netlink_delinearize_obj(struct netlink_ctx *ctx, obj->limit.flags =nftnl_obj_get_u32 (nlo,NFTNL_OBJ_LIMIT_FLAGS );break ; +case NFT_OBJECT_CT_EXPECT : + obj->ct_expect.l3proto = +nftnl_obj_get_u16 (nlo,NFTNL_OBJ_CT_EXPECT_L3PROTO ); + obj->ct_expect.l4proto = +nftnl_obj_get_u8 (nlo,NFTNL_OBJ_CT_EXPECT_L4PROTO ); + obj->ct_expect.dport = +nftnl_obj_get_u16 (nlo,NFTNL_OBJ_CT_EXPECT_DPORT ); + obj->ct_expect.timeout = +nftnl_obj_get_u32 (nlo,NFTNL_OBJ_CT_EXPECT_TIMEOUT ); + obj->ct_expect.size = +nftnl_obj_get_u8 (nlo,NFTNL_OBJ_CT_EXPECT_SIZE ); +break ; } obj->type = type;
src/parser_bison.y +61 -1
122 lines not on this page · raw message
src/parser_json.c +45 -0
75 lines not on this page · raw message
src/rule.c +35 -0
@@ -1429,6 +1429,7 @@ void cmd_free(struct cmd *cmd)case CMD_OBJ_QUOTA :case CMD_OBJ_CT_HELPER :case CMD_OBJ_CT_TIMEOUT : +case CMD_OBJ_CT_EXPECT :case CMD_OBJ_LIMIT :case CMD_OBJ_SECMARK :obj_free (cmd->object);
@@ -1526,6 +1527,7 @@ static int do_command_add(struct netlink_ctx *ctx, struct cmd *cmd, bool excl)case CMD_OBJ_QUOTA :case CMD_OBJ_CT_HELPER :case CMD_OBJ_CT_TIMEOUT : +case CMD_OBJ_CT_EXPECT :case CMD_OBJ_LIMIT :case CMD_OBJ_SECMARK :return mnl_nft_obj_add (ctx, cmd, flags);
@@ -1614,6 +1616,8 @@ static int do_command_delete(struct netlink_ctx *ctx, struct cmd *cmd)return mnl_nft_obj_del (ctx, cmd,NFT_OBJECT_CT_HELPER );case CMD_OBJ_CT_TIMEOUT :return mnl_nft_obj_del (ctx, cmd,NFT_OBJECT_CT_TIMEOUT ); +case CMD_OBJ_CT_EXPECT : +return mnl_nft_obj_del (ctx, cmd,NFT_OBJECT_CT_EXPECT );case CMD_OBJ_LIMIT :return mnl_nft_obj_del (ctx, cmd,NFT_OBJECT_LIMIT );case CMD_OBJ_SECMARK :
@@ -1843,6 +1847,30 @@ static void obj_print_data(const struct obj *obj,print_proto_timeout_policy (obj->ct_timeout.l4proto, obj->ct_timeout.timeout, opts, octx);break ; +case NFT_OBJECT_CT_EXPECT : +nft_print (octx," %s {" , obj->handle.obj.name); +if (nft_output_handle (octx)) +nft_print (octx," # handle %" PRIu64, obj->handle.handle.id); +nft_print (octx,"%s" , opts->nl); +nft_print (octx,"%s%sprotocol " , opts->tab, opts->tab); +print_proto_name_proto (obj->ct_expect.l4proto, octx); +nft_print (octx,"%s" , opts->stmt_separator); +nft_print (octx,"%s%sdport %d%s" , + opts->tab, opts->tab, + obj->ct_expect.dport, + opts->stmt_separator); +nft_print (octx,"%s%stimeout " , opts->tab, opts->tab); +time_print (obj->ct_expect.timeout, octx); +nft_print (octx,"%s" , opts->stmt_separator); +nft_print (octx,"%s%ssize %d%s" , + opts->tab, opts->tab, + obj->ct_expect.size, + opts->stmt_separator); +nft_print (octx,"%s%sl3proto %s%s" , + opts->tab, opts->tab, +family2str (obj->ct_expect.l3proto), + opts->stmt_separator); +break ;case NFT_OBJECT_LIMIT : {bool inv = obj->limit.flags &NFT_LIMIT_F_INV ;const char *data_unit;
@@ -1892,6 +1920,7 @@ static const char * const obj_type_name_array[] = { [NFT_OBJECT_LIMIT] = "limit", [NFT_OBJECT_CT_TIMEOUT] = "ct timeout", [NFT_OBJECT_SECMARK] = "secmark", + [NFT_OBJECT_CT_EXPECT] = "ct expectation", };const char *obj_type_name (enum stmt_types type)
@@ -1908,6 +1937,7 @@ static uint32_t obj_type_cmd_array[NFT_OBJECT_MAX + 1] = { [NFT_OBJECT_LIMIT] = CMD_OBJ_LIMIT, [NFT_OBJECT_CT_TIMEOUT] = CMD_OBJ_CT_TIMEOUT, [NFT_OBJECT_SECMARK] = CMD_OBJ_SECMARK, + [NFT_OBJECT_CT_EXPECT] = CMD_OBJ_CT_EXPECT, };uint32_t obj_type_to_cmd (uint32_t type)
@@ -2266,6 +2296,8 @@ static int do_command_list(struct netlink_ctx *ctx, struct cmd *cmd)return do_list_obj (ctx, cmd,NFT_OBJECT_CT_HELPER );case CMD_OBJ_CT_TIMEOUT :return do_list_obj (ctx, cmd,NFT_OBJECT_CT_TIMEOUT ); +case CMD_OBJ_CT_EXPECT : +return do_list_obj (ctx, cmd,NFT_OBJECT_CT_EXPECT );case CMD_OBJ_LIMIT :case CMD_OBJ_LIMITS :return do_list_obj (ctx, cmd,NFT_OBJECT_LIMIT );
@@ -2486,6 +2518,9 @@ struct cmd *cmd_alloc_obj_ct(enum cmd_ops op, int type, const struct handle *h,case NFT_OBJECT_CT_TIMEOUT : cmd_obj =CMD_OBJ_CT_TIMEOUT ;break ; +case NFT_OBJECT_CT_EXPECT : + cmd_obj =CMD_OBJ_CT_EXPECT ; +break ;default :BUG ("missing type mapping" ); }
src/scanner.l +1 -0
@@ -520,6 +520,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) "reply" { return REPLY; } "direction" { return DIRECTION; } "event" { return EVENT; } +"expectation" { return EXPECTATION; } "expiration" { return EXPIRATION; } "helper" { return HELPER; } "helpers" { return HELPERS; }
src/statement.c +4 -0
@@ -208,6 +208,7 @@ static const char *objref_type[NFT_OBJECT_MAX + 1] = { [NFT_OBJECT_LIMIT] = "limit", [NFT_OBJECT_CT_TIMEOUT] = "ct timeout", [NFT_OBJECT_SECMARK] = "secmark", + [NFT_OBJECT_CT_EXPECT] = "ct expectation", };const char *objref_type_name (uint32_t type)
@@ -227,6 +228,9 @@ static void objref_stmt_print(const struct stmt *stmt, struct output_ctx *octx)case NFT_OBJECT_CT_TIMEOUT :nft_print (octx,"ct timeout set " );break ; +case NFT_OBJECT_CT_EXPECT : +nft_print (octx,"ct expectation set " ); +break ;default :nft_print (octx,"%s name " ,objref_type_name (stmt->objref.type));
tests/py/ip/objects.t +9 -0
@@ -41,3 +41,12 @@ limit name tcp dport map {443 : "lim1", 80 : "lim2", 22 : "lim1"};ok %cttime5 type ct timeout {protocol tcp; policy = { estalbished:100 } ;};fail ct timeout set "cttime1";ok + +# ct expectation +%ctexpect1 type ct expectation { protocol tcp; dport 1234; timeout 2m; size 12; };ok +%ctexpect2 type ct expectation { protocol udp; };fail +%ctexpect3 type ct expectation { protocol tcp; dport 4321; };fail +%ctexpect3 type ct expectation { protocol tcp; dport 4321; timeout 2m; };fail +%ctexpect4 type ct expectation { protocol udp; dport 9876; timeout 2m; size 12; l3proto ip; };ok + +ct expectation set "ctexpect1";ok
tests/py/ip/objects.t.payload +4 -0
@@ -63,3 +63,7 @@ ip test-ip4 output # ct timeout set "cttime1" ip test-ip4 output [ objref type 7 name cttime1 ] + +# ct expectation set "ctexpect1" +ip test-ip4 output + [ objref type 9 name ctexpect1 ]
tests/py/nft-test.py +4 -0
@@ -1123,6 +1123,10 @@ def obj_process(obj_line, filename, lineno): obj_type = "ct timeout" tokens[3] = "" + if obj_type == "ct" and tokens[3] == "expectation": + obj_type = "ct expectation" + tokens[3] = "" + if len(tokens) > 3: obj_spcf = " ".join(tokens[3:])
tests/shell/testcases/listing/0013objects_0 +9 -0
@@ -18,6 +18,14 @@ EXPECTED="table ip test { policy = { unreplied: 15, replied: 12 } } + ct expectation ctexpect { + protocol tcp + dport 5432 + timeout 1h + size 12 + l3proto ip + } + chain input { } }"
@@ -29,6 +37,7 @@ $NFT add chain test input $NFT add quota test https-quota 25 mbytes $NFT add ct helper test cthelp { type \"sip\" protocol tcp \; } $NFT add ct timeout test cttime { protocol udp \; policy = {replied: 12, unreplied: 15 } \; } +$NFT add ct expectation test ctexpect { protocol tcp \; dport 5432 \; timeout 1h \; size 12 \; } $NFT add table test-ip GET="$($NFT list table test)"
tests/shell/testcases/nft-f/0018ct_expectation_obj_0 new file +18 -0
@@ -0,0 +1,18 @@ +#!/bin/bash + +EXPECTED='table ip filter { + ct expectation ctexpect{ + protocol tcp + dport 9876 + timeout 1m + size 12 + l3proto ip + } + + chain c { + ct expectation set "ctexpect" + } +}' + +set -e +$NFT -f - <<< $EXPECTED
Signature · 1 line
2.21.0
Pablo Neira Ayuso
maintainerRe: [PATCH nftables v4 1/1] add ct expectations support
I was going to apply this, but I just noticed a problem.
json compilation breaks:
parser_json.c: In function ‘json_parse_cmd_add_object’:
parser_json.c:2993:20: error: ‘value’ undeclared (first use in this function)
if (!json_unpack(value, "{s:o}", "dport", &tmp))
^~~~~
Please, make sure you run ./configure with --with-json.
Also run:
tests/py# python nft-tests.py -j
to run json tests.
Would you fix this and revamp? I would like that json support is a bit taken as a first class citizen, so Phil does not have to run after every new patch updating the json bits to fix it :-).
Thanks.
Re: [PATCH nftables v4 1/1] add ct expectations support
Quoted 1 line
json compilation breaks:
Thank you for warning me.
Quoted 1 line
Would you fix this and revamp?
Sure! :-)
Signature · 3 lines
Bien cordialement, / Plej kore, Stéphane Veyret
Re: [PATCH nftables v4 1/1] add ct expectations support
In reply to Pablo Neira AyusoQuoted 1 line · Pablo Neira Ayuso
Please, make sure you run ./configure with --with-json.
I'm sorry, but I don't manage to compile it anymore.
I took latest versions of kernel/lib/nft and merged my modifications to nft. But when I try to compile nft, even if the configure goes well, the make fails. The message is that it needs libnftnl > 1.1.3 whereas configure only requires version 1.1.1, and the lib creates a package with version 1.1.2. If I cheat (and update the libnftnl.pc file by hand), then make fails later, when compiling libnftables.c with the following messages :
libnftables.c:112:14: warning: data definition has no type or storage class
EXPORT_SYMBOL(nft_ctx_add_include_path);
^
libnftables.c:112:15: warning: type defaults to ‘int’ in declaration
of « nft_ctx_add_include_path » [-Wimplicit-int]
EXPORT_SYMBOL(nft_ctx_add_include_path);
^~~~~~~~~~~~~~~~~~~~~~~~libnftables.c:112:15: error: « nft_ctx_add_include_path » redeclared as different kind of symbol
In file included from libnftables.c:9:../include/nftables/libnftables.h:76:5: note: previous definition of « nft_ctx_add_include_path » was here
int nft_ctx_add_include_path(struct nft_ctx *ctx, const char *path);
^~~~~~~~~~~~~~~~~~~~~~~~
libnftables.c:113:5: warning: no previous prototype for function «
nft_ctx_add_include_path » [-Wmissing-prototypes]
int nft_ctx_add_include_path(struct nft_ctx *ctx, const char *path)
^~~~~~~~~~~~~~~~~~~~~~~~Does someone have a clue ?
Signature · 3 lines
Bien cordialement, / Plej kore, Stéphane Veyret
Pablo Neira Ayuso
maintainerRe: [PATCH nftables v4 1/1] add ct expectations support
Hi Stéphane,
Quoted 10 lines · Stéphane Veyret
Quoted 1 line · Pablo Neira Ayuso
Please, make sure you run ./configure with --with-json.
I'm sorry, but I don't manage to compile it anymore.
I took latest versions of
kernel/lib/nftand merged my modifications to nft. But when I try to compile nft, even if the configure goes well, the make fails. The message is that it needs libnftnl > 1.1.3 whereas configure only requires version 1.1.1, and the lib creates a package with version 1.1.2.
Make sure you install a fresh libnftnl from git.netfilter.org.
Quoted 15 lines
If I cheat (and update the libnftnl.pc
file by hand), then make fails later, when compilinglibnftables.cwith the following messages :
libnftables.c:112:14: warning: data definition has no type or storage classEXPORT_SYMBOL(nft_ctx_add_include_path); ^ libnftables.c:112:15: warning: type defaults to ‘int’ in declaration of « nft_ctx_add_include_path » [-Wimplicit-int] EXPORT_SYMBOL(nft_ctx_add_include_path); ^~~~~~~~~~~~~~~~~~~~~~~~libnftables.c:112:15: error: «
nft_ctx_add_include_path» redeclared as different kind of symbol
In file included from libnftables.c:9:../include/nftables/libnftables.h:76:5: note: previous definition of «nft_ctx_add_include_path» was here
Quoted 8 lines
int nft_ctx_add_include_path(struct nft_ctx *ctx, const char *path); ^~~~~~~~~~~~~~~~~~~~~~~~ libnftables.c:113:5: warning: no previous prototype for function « nft_ctx_add_include_path » [-Wmissing-prototypes] int nft_ctx_add_include_path(struct nft_ctx *ctx, const char *path) ^~~~~~~~~~~~~~~~~~~~~~~~Does someone have a clue ?
From the nftables tree, after pulling latest changes from git.netfilter.org, run:
autoreconf -fi
before ./configure.
Hi,
I was wondering if you had everything needed for code review of the conntrack expectation support…
Stéphane.