Re: [PATCH nft] expr: add map lookups for numgen statements

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

 



Hi Laura,

On Sun, Apr 22, 2018 at 11:05:53AM +0200, Laura Garcia Liebana wrote:
> +numgen_expr		:	NUMGEN	numgen_type	MOD	NUM	offset_opt	numgen_map_expr

Hint: Instead of adding numgen_map_expr, what you could do is to reuse
the existing parser. Look:

# nft add rule x y numgen inc mod 2 @x
Error: Set 'x' does not exist
add rule x y numgen inc mod 2 @x
                              ^^

So the parser supports this, and the tree looks like this:

                relational
                  /   \
                 /     \
             numgen    map
              expr

> +			{
> +				$$ = numgen_expr_alloc(&@$, $2, $4, $5, $6);

Instead of passing the map as an argument to numgen_expr_alloc().

The idea then from netlink_linearize is to do the appropriate handling
for this tree to generate one single instruction.
--
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