Re: [libnftnl PATCH] expr: xfrm: Fix for unused variable warning

2018-09-25 Thread Máté Eckl
On Tue, Sep 25, 2018 at 03:38:43PM +0200, Florian Westphal wrote: > Phil Sutter wrote: > > On Tue, Sep 25, 2018 at 12:18:50PM +0200, Florian Westphal wrote: > > > Phil Sutter wrote: > > > > In nftnl_expr_xfrm_json_parse(), variable 'spnum' is apparently unused > > > > so remove it. > > > > > >

Re: [libnftnl PATCH] expr: xfrm: Fix for unused variable warning

2018-09-25 Thread Florian Westphal
Phil Sutter wrote: > On Tue, Sep 25, 2018 at 12:18:50PM +0200, Florian Westphal wrote: > > Phil Sutter wrote: > > > In nftnl_expr_xfrm_json_parse(), variable 'spnum' is apparently unused > > > so remove it. > > > > It should be used, "spnum" parsing is missing. > > I see. Máté, do you plan to

Re: [libnftnl PATCH] expr: xfrm: Fix for unused variable warning

2018-09-25 Thread Phil Sutter
On Tue, Sep 25, 2018 at 12:18:50PM +0200, Florian Westphal wrote: > Phil Sutter wrote: > > In nftnl_expr_xfrm_json_parse(), variable 'spnum' is apparently unused > > so remove it. > > It should be used, "spnum" parsing is missing. I see. Máté, do you plan to add the missing bits? Thanks, Phil

nft: Dubious code in get_set_decompose() of src/segtree.c

2018-09-25 Thread Phil Sutter
Hi Pablo, When dealing with a covscan report for nft, I was pointed at the loop's else-clause of get_set_decompose() as it overwrites 'left' without freeing it first. The code in question is this: | list_for_each_entry_safe(i, next, >init->expressions, list) { | if (i->flags &

[nft PATCH 4/5] tests: shell: Improve gen_chains() in 0021prio_0

2018-09-25 Thread Phil Sutter
Enhance the function to accept an optional fourth parameter specifying the device name, then use it for netdev family. Also remove dubled empty lines and instead put together what belongs together. Signed-off-by: Phil Sutter --- tests/shell/testcases/chains/0021prio_0 | 15 --- 1

[nft PATCH 2/5] tests: shell: Fix indenting in 0021prio_0

2018-09-25 Thread Phil Sutter
Pointless indenting doesn't increase readability, merely makes the script seem more complicated than it actually is. Signed-off-by: Phil Sutter --- tests/shell/testcases/chains/0021prio_0 | 67 - 1 file changed, 33 insertions(+), 34 deletions(-) diff --git

[nft PATCH 5/5] tests: shell: Improve performance of 0021prio_0

2018-09-25 Thread Phil Sutter
This test called nft binary 391 times and took about 38s to complete on my testing VM. Improve this by writing all commands into a temporary file for processing in a single nft call. Reduces run-time to about 4s. Interestingly, piping the sub-process's output directly into 'nft -f -' leads to

[nft PATCH 3/5] tests: shell: Drop one-time use variables in 0021prio_0

2018-09-25 Thread Phil Sutter
There is really no point in declaring a variable which is used just once. Also mark function local variables as such to make sure they don't overwrite global ones. Signed-off-by: Phil Sutter --- tests/shell/testcases/chains/0021prio_0 | 45 + 1 file changed, 15

[nft PATCH 1/5] parser_bison: Fix for chain prio name 'out'

2018-09-25 Thread Phil Sutter
Since 'out' is defined as a keyword in scanner.l, using it as a chain priority name without quotes is not possible. Fix this by introducing 'extended_prio_name' in bison which may be either a string (as before) or OUT, which is then converted into a string. Fixes: c8a0e8c90e2d1 ("src: Set/print

[nft PATCH 0/5] Fix and improve for 0021prio_0 in tests/shell

2018-09-25 Thread Phil Sutter
Patch 1 contains a fix for parser_bison.y to accept 'out' as priority name (again a keyword vs. string issue). The remaining patches deal with flaws in the test case itself, including the whopping 38s it took to complete on my testing VM. Phil Sutter (5): parser_bison: Fix for chain prio name

Contribution of a GRE Module

2018-09-25 Thread Alexandre Connat
Hello, developers of Netfilter, I wanted to tell you some things, and ask you a few questions : For a student project, I wrote a Netfilter module (both a Match, and a Target) that allows you to play with the GRE Header reserved flags. (Why on earth would you do that? Well, it could be used

Re: [libnftnl PATCH] expr: xfrm: Fix for unused variable warning

2018-09-25 Thread Florian Westphal
Phil Sutter wrote: > In nftnl_expr_xfrm_json_parse(), variable 'spnum' is apparently unused > so remove it. It should be used, "spnum" parsing is missing.

[libnftnl PATCH] expr: xfrm: Fix for unused variable warning

2018-09-25 Thread Phil Sutter
In nftnl_expr_xfrm_json_parse(), variable 'spnum' is apparently unused so remove it. Fixes: f4621a6f87064 ("expr: add xfrm support") Signed-off-by: Phil Sutter --- src/expr/xfrm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expr/xfrm.c b/src/expr/xfrm.c index