All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Florian Westphal <fw@strlen.de>
Cc: "Serguei Bezverkhi (sbezverk)" <sbezverk@cisco.com>,
	Phil Sutter <phil@nwl.cc>,
	"netfilter-devel@vger.kernel.org"
	<netfilter-devel@vger.kernel.org>
Subject: Re: Ipv6 address in concatenation
Date: Thu, 27 Feb 2020 20:43:48 +0100	[thread overview]
Message-ID: <20200227194348.GQ19559@breakpoint.cc> (raw)
In-Reply-To: <20200227194229.GP19559@breakpoint.cc>

Florian Westphal <fw@strlen.de> wrote:
> Serguei Bezverkhi (sbezverk) <sbezverk@cisco.com> wrote:
> > Hello,
> > 
> > I started testing  nfproxy in ipv6 enabled kubernetes cluster and it seems ipv6 address cannot be a part of concatenation expression. Is there a known issue or it is me doing something incorrect?
> > From my side the code is the same, I just change ip4_addr to ip6_addr when I build sets.
> 
> types are irrelvant for the kernel.  They are ONLY used by the nft tool
> so it knows how to format output.
> 
> I suspect you need to fix up the generated payload expressions
> for ipv6.  Essentially, in the ipv6 case, you have a concatenation
> 
> ipv4_addr . ipv4_addr . ip4_addr . ipv4_addr . inet_service
> 
> (ipv6 address needs 4 32-bit registers)
> 
> i.e., you need to use a different destination register when you store
> the tcp/udp port, else you will clobber a part of the ipv6 address.

Addendum: you can check with

nft --debug=netlink list ruleset

to make sure the registers get populated as expected by lookup
expression.

  reply	other threads:[~2020-02-27 19:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 16:21 Ipv6 address in concatenation Serguei Bezverkhi (sbezverk)
2020-02-27 17:17 ` Phil Sutter
2020-02-27 19:42 ` Florian Westphal
2020-02-27 19:43   ` Florian Westphal [this message]
2020-02-27 21:25   ` Serguei Bezverkhi (sbezverk)
2020-02-27 21:45     ` Florian Westphal

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=20200227194348.GQ19559@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=phil@nwl.cc \
    --cc=sbezverk@cisco.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.