Thread (4 messages) 4 messages, 3 authors, 2022-01-11

Re: [PATCH] netfilter: extend CONFIG_NF_CONNTRACK compile time checks

flat view

From: Florian Westphal <fw@strlen.de>
Date: 2022-01-11 14:29:11
Also in: lkml, netfilter-devel

Tom Rix [off-list ref] wrote:
On 1/11/22 1:46 AM, Pablo Neira Ayuso wrote:
quoted
Hi,

On Sat, Dec 25, 2021 at 09:37:44AM -0800, trix@redhat.com wrote:
quoted
From: Tom Rix <trix@redhat.com>

Extends
commit 83ace77f5117 ("netfilter: ctnetlink: remove get_ct indirection")

Add some compile time checks by following the ct and ctinfo variables
that are only set when CONFIG_NF_CONNTRACK is enabled.

In nfulnl_log_packet(), ct is only set when CONFIG_NF_CONNTRACK
is enabled. ct's later use in __build_packet_message() is only
meaningful when CONFIG_NF_CONNTRACK is enabled, so add a check.

In nfqnl_build_packet_message(), ct and ctinfo are only set when
CONFIG_NF_CONNTRACK is enabled.  Add a check for their decl and use.

nfqnl_ct_parse() is a static function, move the check to the whole
function.

In nfqa_parse_bridge(), ct and ctinfo are only set by the only
call to nfqnl_ct_parse(), so add a check for their decl and use.

Consistently initialize ctinfo to 0.
Are compile warning being trigger without this patch, maybe with
CONFIG_NF_CONNTRACK=n?
No compiler warnings, this was found by visual inspection.

Robot says to entend more, so I want to make sure a human is also
interested.
I hoped compiler was able to remove that without aid of preprocessor :/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help