Florian Westphal <fw@xxxxxxxxx> wrote: > Allow switch of the flex state from bison parser. > Note that this switch will happen too late to cover all cases: > > nft add ip dup fwd ip saddr ... # adds a rule to chain fwd in table dup > nft add dup fwd ... # syntax error (flex parses dup as expression keyword) > > to solve this, bison must carry a list of keywords that are allowed to > be used as table names. > > This adds FWD as an example. When new keywords are added, this can > then be extended as needed. > > Another alternative is to deprecate implicit rule add altogether > so users would have to move to 'nft add rule ...'. ... and another alternative is to not allow arbitrary table/chain/set names after all. We could just say that all future tokens that could break existing table/chain/set name need to be added to the 'identifier' in parser_bison.y. Provided new expressions with args use start conditionals the list of tokens would probably stay short. Given the 'set' complication Phil mentioned that might be the best way forward.