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:
a16d6c3
)
tools: Adding capability to load necessary modules into iptables-test
author
Tomasz Bursztyka
<tomasz.bursztyka@linux.intel.com>
Thu, 22 Sep 2011 12:39:32 +0000
(15:39 +0300)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Thu, 22 Sep 2011 13:22:47 +0000
(15:22 +0200)
tools/iptables-test.c
patch
|
blob
|
history
diff --git
a/tools/iptables-test.c
b/tools/iptables-test.c
index
a7193c2
..
887fd3c
100644
(file)
--- a/
tools/iptables-test.c
+++ b/
tools/iptables-test.c
@@
-1137,9
+1137,22
@@
static int add_entry(struct ipt_entry *entry, struct connman_iptables *table)
static struct connman_iptables *connman_iptables_init(const char *table_name)
{
static struct connman_iptables *connman_iptables_init(const char *table_name)
{
- struct connman_iptables *table;
+ struct connman_iptables *table = NULL;
+ char *module = NULL;
socklen_t s;
socklen_t s;
+ if (xtables_insmod("ip_tables", NULL, TRUE) != 0)
+ goto err;
+
+ module = g_strconcat("iptable_", table_name, NULL);
+ if (module == NULL)
+ goto err;
+
+ if (xtables_insmod(module, NULL, TRUE) != 0)
+ goto err;
+
+ g_free(module);
+
table = g_try_new0(struct connman_iptables, 1);
if (table == NULL)
return NULL;
table = g_try_new0(struct connman_iptables, 1);
if (table == NULL)
return NULL;
@@
-1182,10
+1195,10
@@
static struct connman_iptables *connman_iptables_init(const char *table_name)
table->blob_entries->size,
add_entry, table);
table->blob_entries->size,
add_entry, table);
-
return table;
err:
return table;
err:
+ g_free(module);
connman_iptables_cleanup(table);
connman_iptables_cleanup(table);