From: Tomasz Bursztyka Date: Thu, 10 Nov 2011 09:02:22 +0000 (+0200) Subject: tools: Initiate defined table before working on it in iptables-test X-Git-Tag: 0.78~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=178c2055e7ab6be3f7fd5fd89c2698e1f8b038da;p=platform%2Fupstream%2Fconnman.git tools: Initiate defined table before working on it in iptables-test --- diff --git a/tools/iptables-test.c b/tools/iptables-test.c index 3bbe43b..b3f1ce1 100644 --- a/tools/iptables-test.c +++ b/tools/iptables-test.c @@ -1561,6 +1561,11 @@ int main(int argc, char *argv[]) case 't': table_name = optarg; + + table = connman_iptables_init(table_name); + if (table == NULL) + return -1; + break; case 1: @@ -1653,12 +1658,13 @@ int main(int argc, char *argv[]) xt_t->final_check(xt_t->tflags); #endif - if (table_name == NULL) + if (table == NULL) { table_name = "filter"; - table = connman_iptables_init(table_name); - if (table == NULL) - return -1; + table = connman_iptables_init(table_name); + if (table == NULL) + return -1; + } if (delete) { if (delete_chain == NULL)