On Wed, May 24, 2017 at 05:48:20PM +0200, Pablo Neira Ayuso wrote:
> On Wed, May 24, 2017 at 03:11:04PM +0200, Arturo Borrero Gonzalez wrote:
> > Prevent this assert:
> >
> > % nft [..] tcp dport set { 0 , 1 }
> > BUG: unknown expression type set reference
> > nft: netlink_linearize.c:696: netlink_gen_expr: Assertion `0' failed.
> > Aborted
> >
> > We can't use a set here because we will not known what value to use.
> >
> > With this patch, this is produced:
> >
> > % nft [..] tcp dport set {1, 2 }
> > <cmdline>:1:19-27: Error: you cannot use a set here
> > add rule ip nat c tcp dport set {1, 2 }
> > ^^^^^^^^^~~~~~~~~~~~~
> > % nft [..] tcp dport set @s
> > <cmdline>:1:19-27: Error: you cannot reference a set here
> > add rule ip nat c tcp dport set @s
> > ^^^^^^^^^~~~~~~~
> >
> > Using maps is still allowed:
> >
> > % nft [..] tcp dport set numgen inc mod 2 map { 0 : 4040 , 1 : 4050 }
>
> Good catch.
>
> I think we should reject this more generically, ie.
>
> nft add rule x y meta mark set {1, 2 }
I mean, the example above is not payload, but it should be rejected
too.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html