Re: [PATCH 2/2 nft WIP v2] jump: Allow jump to a variable when using nft input files

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

 



Hi Phil,

On 5/14/19 6:17 PM, Phil Sutter wrote:
> Hi Fernando,
> 
> On Tue, May 14, 2019 at 05:43:39PM +0200, Fernando Fernandez Mancera wrote:
>> This last patch does not work. The first one works fine with a string as
>> chain name.
>>
> [...]
>> [...]
>> This error comes from symbol_parse() at expr_evaluate_symbol() after the
>> expr_evaluate() call added in the first patch.
> 
> Yes, symbol_expr is used only for symbolic constants, therefore
> symbol_parse() is very restrictive.
> 
> [...]>>> diff --git a/src/parser_bison.y b/src/parser_bison.y
>>> index 69b5773..42fd71f 100644
>>> --- a/src/parser_bison.y
>>> +++ b/src/parser_bison.y
>>> @@ -3841,7 +3841,13 @@ verdict_expr		:	ACCEPT
>>>  			}
>>>  			;
>>>  
>>> -chain_expr		:	identifier
>>> +chain_expr		:	variable_expr
>>> +			{
>>> +				$$ = symbol_expr_alloc(&@$, SYMBOL_VALUE,
>>> +						       current_scope(state),
>>> +						       $1->sym->identifier);
>>> +			}
> 
> I didn't test it, but you can probably just drop the curly braces and
> everything inside here. 'variable_expr' already turns into an
> expression (a variable_expr, not symbol_expr), which is probably what
> you want.
> 

I tried that first and I got the same error. I have tried it again.. and
I am getting the same error.

file.nft:1:15-17: Error: Can't parse symbolic netfilter verdict expressions
define dest = ber
              ^^^

Thanks! :-)
>>> +			|	identifier
>>>  			{
>>>  				$$ = constant_expr_alloc(&@$, &string_type,
>>>  							 BYTEORDER_HOST_ENDIAN,
>>>
>>
> 
> Cheers, Phil
> 



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux