---
 src/iptables.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/iptables.c b/src/iptables.c
index d97efea..142d277 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -1138,11 +1138,25 @@ static void table_cleanup(struct connman_iptables 
*table)
 
 static struct connman_iptables *iptables_init(char *table_name)
 {
-       struct connman_iptables *table;
+       struct connman_iptables *table = NULL;
+       char *module = NULL;
        socklen_t s;
 
        DBG("%s", table_name);
 
+       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);
+       module = NULL;
+
        table = g_hash_table_lookup(table_hash, table_name);
        if (table != NULL)
                return table;
@@ -1194,6 +1208,7 @@ static struct connman_iptables *iptables_init(char 
*table_name)
        return table;
 
 err:
+       g_free(module);
 
        table_cleanup(table);
 
-- 
1.7.3.4

_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to