]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
parser_bison: show all sets via list sets with no family
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 25 Sep 2015 10:44:42 +0000 (12:44 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 12 Oct 2015 18:34:22 +0000 (20:34 +0200)
Default to the same behaviour that we get through `list ruleset', ie.

 # nft list sets
 table ip test1 {
        set foo {
                type ipv4_addr
        }
 }
 table ip6 test2 {
        set bar {
                type ipv6_addr
        }
 }

 # nft list sets ip
 table ip test1 {
        set foo {
                type ipv4_addr
        }
 }

 # nft list sets ip6
 table ip6 test2 {
        set bar {
                type ipv6_addr
        }
 }

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
src/parser_bison.y

index 86e2dc959e47718cdfafd7c7df7c791c28b3b65f..98480b600eb545699f60520bb9c723ce1843618c 100644 (file)
@@ -416,8 +416,8 @@ static void location_update(struct location *loc, struct location *rhs, int n)
 %type <cmd>                    base_cmd add_cmd create_cmd insert_cmd delete_cmd list_cmd flush_cmd rename_cmd export_cmd monitor_cmd describe_cmd
 %destructor { cmd_free($$); }  base_cmd add_cmd create_cmd insert_cmd delete_cmd list_cmd flush_cmd rename_cmd export_cmd monitor_cmd describe_cmd
 
-%type <handle>                 table_spec tables_spec chain_spec chain_identifier ruleid_spec ruleset_spec
-%destructor { handle_free(&$$); } table_spec tables_spec chain_spec chain_identifier ruleid_spec ruleset_spec
+%type <handle>                 table_spec chain_spec chain_identifier ruleid_spec ruleset_spec
+%destructor { handle_free(&$$); } table_spec chain_spec chain_identifier ruleid_spec ruleset_spec
 %type <handle>                 set_spec set_identifier
 %destructor { handle_free(&$$); } set_spec set_identifier
 %type <val>                    handle_spec family_spec family_spec_explicit position_spec chain_policy
@@ -784,7 +784,7 @@ list_cmd            :       TABLE           table_spec
                        {
                                $$ = cmd_alloc(CMD_LIST, CMD_OBJ_CHAINS, &$2, &@$, NULL);
                        }
-                       |       SETS            tables_spec
+                       |       SETS            ruleset_spec
                        {
                                $$ = cmd_alloc(CMD_LIST, CMD_OBJ_SETS, &$2, &@$, NULL);
                        }
@@ -1195,14 +1195,6 @@ table_spec               :       family_spec     identifier
                        }
                        ;
 
-tables_spec            :       family_spec
-                       {
-                               memset(&$$, 0, sizeof($$));
-                               $$.family       = $1;
-                               $$.table        = NULL;
-                       }
-                       ;
-
 chain_spec             :       table_spec      identifier
                        {
                                $$              = $1;