On Sat, Jan 06, 2018 at 11:57:29PM +0530, Harsha Sharma wrote: > This patch allows deletion of table via unique table handles which can > be listed with '-a' option. > For.eg. > nft delete table handle 4 > > Signed-off-by: Harsha Sharma <harshasharmaiitr@xxxxxxxxx> > --- > src/parser_bison.y | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/src/parser_bison.y b/src/parser_bison.y > index 6e85a62..a7c8bbf 100644 > --- a/src/parser_bison.y > +++ b/src/parser_bison.y > @@ -495,8 +495,8 @@ int nft_lex(void *, void *, void *); > %type <cmd> base_cmd add_cmd replace_cmd create_cmd insert_cmd delete_cmd list_cmd reset_cmd flush_cmd rename_cmd export_cmd monitor_cmd describe_cmd > %destructor { cmd_free($$); } base_cmd add_cmd replace_cmd create_cmd insert_cmd delete_cmd list_cmd reset_cmd flush_cmd rename_cmd export_cmd monitor_cmd describe_cmd > > -%type <handle> table_spec chain_spec chain_identifier ruleid_spec handle_spec position_spec rule_position ruleset_spec > -%destructor { handle_free(&$$); } table_spec chain_spec chain_identifier ruleid_spec handle_spec position_spec rule_position ruleset_spec > +%type <handle> table_spec tableid_spec chain_spec chain_identifier ruleid_spec handle_spec position_spec rule_position ruleset_spec > +%destructor { handle_free(&$$); } table_spec tableid_spec chain_spec chain_identifier ruleid_spec handle_spec position_spec rule_position ruleset_spec > %type <handle> set_spec set_identifier obj_spec obj_identifier > %destructor { handle_free(&$$); } set_spec set_identifier obj_spec obj_identifier > %type <val> family_spec family_spec_explicit chain_policy prio_spec > @@ -978,6 +978,10 @@ delete_cmd : TABLE table_spec > { > $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_TABLE, &$2, &@$, NULL); > } > + | TABLE tableid_spec Use handle_spec instead, so we don't need the empty tableid_spec. BTW, where is the HANDLE token in the grammar? Did you test nft delete table handle 4 that really works? -- 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