lkml.org 
[lkml]   [2022]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] netfilter: extend CONFIG_NF_CONNTRACK compile time checks
Tom Rix <trix@redhat.com> wrote:
>
> On 1/11/22 1:46 AM, Pablo Neira Ayuso wrote:
> > Hi,
> >
> > On Sat, Dec 25, 2021 at 09:37:44AM -0800, trix@redhat.com wrote:
> > > 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 :/

\
 
 \ /
  Last update: 2022-01-11 15:30    [W:0.035 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site