[PATCH nf-next 6/7] netfilter: conntrack: print_conntrack only needed if CONFIG_NF_CONNTRACK_PROCFS

2017-08-11 Thread Florian Westphal
Signed-off-by: Florian Westphal --- include/net/netfilter/nf_conntrack_l4proto.h | 7 --- net/netfilter/nf_conntrack_proto_dccp.c | 6 ++ net/netfilter/nf_conntrack_proto_gre.c | 4 net/netfilter/nf_conntrack_proto_sctp.c | 6 ++

[PATCH nf-next 5/7] netfilter: conntrack: place print_tuple in procfs part

2017-08-11 Thread Florian Westphal
CONFIG_NF_CONNTRACK_PROCFS is deprecated, no need to use a function pointer in the trackers for this. Place the printf formatting in the one place that uses it. Signed-off-by: Florian Westphal --- include/net/netfilter/nf_conntrack_l3proto.h | 4 --

[PATCH nf-next 3/7] netfilter: conntrack: remove protocol name from l4proto struct

2017-08-11 Thread Florian Westphal
no need to waste storage for something that is only needed in one place and can be deduced from protocol number. Signed-off-by: Florian Westphal --- include/net/netfilter/nf_conntrack_l4proto.h | 3 --- net/ipv4/netfilter/nf_conntrack_proto_icmp.c | 1 -

[PATCH nf-next 4/7] netfilter: conntrack: reduce size of l4protocol trackers

2017-08-11 Thread Florian Westphal
can use u16 for both, shrinks size by another 8 bytes. Signed-off-by: Florian Westphal --- include/net/netfilter/nf_conntrack_l4proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/net/netfilter/nf_conntrack_l4proto.h

[PATCH nf-next 7/7] netfilter: conntrack: make protocol tracker pointers const

2017-08-11 Thread Florian Westphal
Doesn't change generated code, but will make it easier to eventually make the actual trackers themselvers const. Signed-off-by: Florian Westphal --- include/net/netfilter/nf_conntrack_l3proto.h | 6 +++--- include/net/netfilter/nf_conntrack_l4proto.h | 4 ++--

[PATCH nf-next 1/7] netfilter: conntrack: compute l3proto nla size at compile time

2017-08-11 Thread Florian Westphal
avoids a pointer and allows struct to be const later on. Signed-off-by: Florian Westphal --- include/net/netfilter/nf_conntrack_l3proto.h | 19 --- net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 13 +++-- net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c

[PATCH nf-next 2/7] netfilter: conntrack: remove protocol name from l3proto struct

2017-08-11 Thread Florian Westphal
no need to waste storage for something that is only needed in one place and can be deduced from protocol number. Signed-off-by: Florian Westphal --- include/net/netfilter/nf_conntrack_l3proto.h | 3 --- net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 1 -

[PATCH nf-next 0/7] netfilter: conntrack: constify protocol trackers, part 1

2017-08-11 Thread Florian Westphal
This is an initial series of patches to mark the l3 and l4 protocol handler structs as const. Only reason why we can't constify them now is that l3 and l4 trackers compute netlink attribute size needed at init time and store result in the proto struct. First patch switches the l3 trackers to

[PATCH v2] netfilter: nf_nat_h323: fix logical-not-parentheses warning

2017-08-11 Thread Nick Desaulniers
Clang produces the following warning: net/ipv4/netfilter/nf_nat_h323.c:553:6: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses] if (!set_h225_addr(skb, protoff, data, dataoff, taddr, ^ add parentheses after the '!' to evaluate

Re: [PATCH] netfilter: nf_nat_h323: fix logical-not-parentheses warning

2017-08-11 Thread Pablo Neira Ayuso
Hi Nick, On Mon, Jul 31, 2017 at 11:39:49AM -0700, Nick Desaulniers wrote: > Clang produces the following warning: [...] > Also, it's even cleaner to use the form: > > if (x) > > but then if the return codes change from treating 0 as success (unlikely), > then all call sites must be updated. >

Re: RFC: Synopsis syntax change in nft.8

2017-08-11 Thread Phil Sutter
On Fri, Aug 11, 2017 at 12:44:25AM +0200, Jan Engelhardt wrote: > On Thursday 2017-08-10 20:29, Phil Sutter wrote: [...] > >What do you think? > > The styling _is_ written down: The Linux man-pages project has, since Tue May > 22 2007, a man-pages.7 file. It says: bold="as-is text",

Re: RFC: Synopsis syntax change in nft.8

2017-08-11 Thread Phil Sutter
On Thu, Aug 10, 2017 at 11:55:03PM +0200, Florian Westphal wrote: > FWIW I am not a docbook fan so I would not mind if we switch to > another markup system. I'd prefer to write directly in roff as well. Doing so would also eliminate the dependency to docbook (which I had problems with when