projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
178c205
)
iptables: Initiate defined table before working on it
author
Tomasz Bursztyka
<tomasz.bursztyka@linux.intel.com>
Thu, 10 Nov 2011 09:02:23 +0000
(11:02 +0200)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Mon, 14 Nov 2011 15:44:09 +0000
(16:44 +0100)
src/iptables.c
patch
|
blob
|
history
diff --git
a/src/iptables.c
b/src/iptables.c
index
f562f32
..
9d6a9e7
100644
(file)
--- a/
src/iptables.c
+++ b/
src/iptables.c
@@
-1572,6
+1572,13
@@
static int iptables_command(int argc, char *argv[])
case 't':
table_name = optarg;
+
+ table = iptables_init(table_name);
+ if (table == NULL) {
+ ret = -EINVAL;
+ goto out;
+ }
+
break;
case 1:
@@
-1662,13
+1669,14
@@
static int iptables_command(int argc, char *argv[])
xt_t->final_check(xt_t->tflags);
#endif
- if (table
_name == NULL)
+ if (table
== NULL) {
table_name = "filter";
- table = iptables_init(table_name);
- if (table == NULL) {
- ret = -EINVAL;
- goto out;
+ table = iptables_init(table_name);
+ if (table == NULL) {
+ ret = -EINVAL;
+ goto out;
+ }
}
if (delete_chain != NULL) {