summaryrefslogtreecommitdiff
path: root/src/iptables.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-10-12 14:01:31 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-10-15 09:36:26 +0300
commit0306d64c9033814eae433cab973e68befef52525 (patch)
tree529f8cecf15da50ec27b6f745765354b4d192d02 /src/iptables.c
parent237259bc8bf86aa62d5ad259b804b2f8874b77b0 (diff)
downloadconnman-0306d64c9033814eae433cab973e68befef52525.tar.gz
connman-0306d64c9033814eae433cab973e68befef52525.tar.bz2
connman-0306d64c9033814eae433cab973e68befef52525.zip
iptables: Ignore module loading error
In iptables 1.4.9 module loading gives an error even if the module is built in. Ignore the loading errors because the missing iptables support is noticed when trying to get the iptables socket options.
Diffstat (limited to 'src/iptables.c')
-rw-r--r--src/iptables.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/iptables.c b/src/iptables.c
index ccd54acf..147d6042 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -1234,16 +1234,14 @@ static struct connman_iptables *iptables_init(char *table_name)
DBG("%s", table_name);
if (xtables_insmod("ip_tables", NULL, TRUE) != 0)
- return NULL;
+ DBG("ip_tables module loading gives error but trying anyway");
module = g_strconcat("iptable_", table_name, NULL);
if (module == NULL)
return NULL;
- if (xtables_insmod(module, NULL, TRUE) != 0) {
- g_free(module);
- return NULL;
- }
+ if (xtables_insmod(module, NULL, TRUE) != 0)
+ DBG("%s module loading gives error but trying anyway", module);
g_free(module);
@@ -1266,8 +1264,11 @@ static struct connman_iptables *iptables_init(char *table_name)
s = sizeof(*table->info);
strcpy(table->info->name, table_name);
if (getsockopt(table->ipt_sock, IPPROTO_IP, IPT_SO_GET_INFO,
- table->info, &s) < 0)
+ table->info, &s) < 0) {
+ connman_error("iptables support missing error %d (%s)", errno,
+ strerror(errno));
goto err;
+ }
table->blob_entries = g_try_malloc0(sizeof(struct ipt_get_entries) +
table->info->size);