struct nftnl_rule *rule;
int ret = 0, i;
- for (i = 0; i < TABLES_MAX; i++) {
- if (!h->tables[i].name)
- continue;
- if (strcmp(h->tables[i].name, tablename) == 0)
- break;
- }
-
- if (i == TABLES_MAX)
+ if (!nft_table_builtin_find(h, tablename))
return false;
ret = nft_are_chains_compatible(h, tablename);
struct nftnl_chain_list *chain_list;
- if (!nft_table_find(h, tablename)) {
- printf("Table `%s' does not exist\n", tablename);
- return 1;
- }
-
if (!nft_is_table_compatible(h, tablename)) {
- printf("# Table `%s' is incompatible, use 'nft' tool.\n", tablename);
+ if (!nft_table_builtin_find(h, tablename))
+ printf("# Table `%s' is incompatible, use 'nft' tool.\n",
+ tablename);
return 0;
}
return !!ret;
}
+ if (!nft_table_find(h, tablename)) {
+ printf("Table `%s' does not exist\n", tablename);
+ return 1;
+ }
+
ret = __do_output(h, tablename, counters);
nft_check_xt_legacy(h->family, true);
return ret;