Re: [PATCH nft 3/3] src: only print the mss and wscale of synproxy if they are present

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 4, 2025 at 7:54 PM Florian Westphal <fw@xxxxxxxxx> wrote:
>
> Zhongqiu Duan <dzq.aishenghu0@xxxxxxxxx> wrote:
> > The listing of the synproxy statement will print a zero value
> > for unpresented fields.
> >
> > e.g., the rule add by `nft add rule inet t c synproxy wscale 8 sack-perm`
> > will print as 'synproxy mss 0 wscale 8 sack-perm'.
> >
> > Signed-off-by: Zhongqiu Duan <dzq.aishenghu0@xxxxxxxxx>
> > ---
> >  src/statement.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/statement.c b/src/statement.c
> > index 695b57a6cc65..ced002f63115 100644
> > --- a/src/statement.c
> > +++ b/src/statement.c
> > @@ -1058,7 +1058,7 @@ static void synproxy_stmt_print(const struct stmt *stmt,
> >       const char *ts_str = synproxy_timestamp_to_str(flags);
> >       const char *sack_str = synproxy_sack_to_str(flags);
> >
> > -     if (flags & (NF_SYNPROXY_OPT_MSS | NF_SYNPROXY_OPT_WSCALE))
> > +     if ((flags & NF_SYNPROXY_OPT_MSS) && (flags & NF_SYNPROXY_OPT_WSCALE))
> >               nft_print(octx, "synproxy mss %u wscale %u%s%s",
> >                         stmt->synproxy.mss, stmt->synproxy.wscale,
> >                         ts_str, sack_str);
>
> This looks wrong, this will now only print it if both are set.

The following else branch will handle the other conditions.

Regards,
Zhongqiu





[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux