Re: [nft PATCH] evaluate: prevent using sets in payload statements

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

 



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 }
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux