All of lore.kernel.org
 help / color / mirror / Atom feed
* Possible nftables U32 equivalent to read packet's data contents
@ 2017-08-30 21:59 Raul Martinez
  2017-09-01 10:30 ` Pablo Neira Ayuso
  2017-10-03 13:34 ` Pablo Neira Ayuso
  0 siblings, 2 replies; 6+ messages in thread
From: Raul Martinez @ 2017-08-30 21:59 UTC (permalink / raw)
  To: netfilter@vger.kernel.org

Hi all,

Looking for a way to implement an expression that can read the first few bytes of an packet's data contents.
It seems this is only possible using raw expressions such as @ll and @nh  with an offset that goes past the header length and into the packet's data.
Is there another keyword that supports u32 behavior that I am missing? Will this approach fail because of some internal check to prevent out of bounds reads?

Another question is if raw expressions have been fixed or is there a kernel change required to enable raw expressions?
I still get the below error when I try to use 2017 nftables. 

Re: nftables: Example involving payload_raw_expr

On Mon, Nov 30, 2015 at 02:28:38PM +0100, Stefan Berghofer wrote:
> > Hi all,
> >
> > I just tried out the example file tests/payload-ll distributed with nftables,
> >  which makes use of payload raw expressions of the form "@..,..,..". While the first
> > two declarations in the file, i.e.
> >
> >  nft add table ip filter
> > nft add chain ip filter input \{ type filter hook input priority 0\; \}
> >
> >work as expected, the third declaration
> >
> >  nft add rule ip filter input @ll,48,48 00:15:e9:f0:10:f8 counter
> >
> > is rejected with the error message
> > 
> >   Error: protocol specification is invalid for this family

> It seems this got broken at some stage of the development, so it would
> be good to get this back working and add tests to our regression test
> infrastructure so we make sure this doesn't break again.

Thanks,
Raul


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-03 13:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-30 21:59 Possible nftables U32 equivalent to read packet's data contents Raul Martinez
2017-09-01 10:30 ` Pablo Neira Ayuso
2017-09-01 16:39   ` Raul Martinez
2017-09-04 20:55     ` Pablo Neira Ayuso
2017-09-05 17:04       ` Raul Martinez
2017-10-03 13:34 ` Pablo Neira Ayuso

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.