netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kyle Swenson <kyle.swenson@est.tech>
To: Florian Westphal <fw@strlen.de>
Cc: "netfilter-devel@vger.kernel.org" <netfilter-devel@vger.kernel.org>
Subject: Re: [RFC PATCH 1/1] netfilter: nat: restore default DNAT behavior
Date: Mon, 29 Jan 2024 21:06:48 +0000	[thread overview]
Message-ID: <ZbgTZhKiJ1dfDzOU@p620> (raw)
In-Reply-To: <20240129071656.GA9973@breakpoint.cc>

On Mon, Jan 29, 2024 at 08:16:56AM +0100, Florian Westphal wrote:
> Kyle Swenson <kyle.swenson@est.tech> wrote:
> > > Can you restrict this to NF_NAT_MANIP_DST?
> > > I don't want predictable src port conflict resolution.
> > > 
> > > Probably something like (untested):
> > > 
> > > find_free_id:
> > >  	if (range->flags & NF_NAT_RANGE_PROTO_OFFSET)
> > >  		off = (ntohs(*keyptr) - ntohs(range->base_proto.all));
> > > +	else if ((range->flags & NF_NAT_RANGE_PROTO_SPECIFIED) &&
> > > +	  	  maniptype == NF_NAT_MANIP_DST))
> > > + 		off = 1;
> > > 	else
> > >   		off = get_random_u16();
> > 
> > Yes, absolutely.  I'll test out the change and send a v2 next week.
> 
> Thanks! Please tweak the suggestion so that --random still overrides
> --range behavior.

Sure, no problem.

      reply	other threads:[~2024-01-29 21:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26  0:05 [RFC PATCH 0/1] netfilter: nat: restore default DNAT behavior Kyle Swenson
2024-01-26  0:05 ` [RFC PATCH 1/1] " Kyle Swenson
2024-01-26 15:57   ` Florian Westphal
2024-01-26 19:02     ` Kyle Swenson
2024-01-29  7:16       ` Florian Westphal
2024-01-29 21:06         ` Kyle Swenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZbgTZhKiJ1dfDzOU@p620 \
    --to=kyle.swenson@est.tech \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).