summaryrefslogtreecommitdiff
path: root/src/iptables.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2013-03-06 16:08:49 +0100
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-03-07 10:07:06 +0200
commit63994912c07341c62c91fdffe4b372cb06c8b624 (patch)
treebda8e851c2dacf10fa3b40b0b8d84b61c94cabd0 /src/iptables.c
parentde357ea1923ad02860a3a416bd1579f94c0275be (diff)
downloadconnman-63994912c07341c62c91fdffe4b372cb06c8b624.tar.gz
connman-63994912c07341c62c91fdffe4b372cb06c8b624.tar.bz2
connman-63994912c07341c62c91fdffe4b372cb06c8b624.zip
iptables: Fix is_fallthrough() check
A fallthrough rule is one which has the default target name, does not have a verdict and is not a jump rule. is_fallthrough() is called excluslive from the insert path, thus the value of verdict will be 0 for a fallthrough rule.
Diffstat (limited to 'src/iptables.c')
-rw-r--r--src/iptables.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/iptables.c b/src/iptables.c
index c5776b1c..fe5214a5 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -301,9 +301,13 @@ static gboolean is_fallthrough(struct connman_iptables_entry *e)
struct xt_entry_target *target;
target = ipt_get_target(e->entry);
- if (!strcmp(target->u.user.name, ""))
- return true;
+ if (!g_strcmp0(target->u.user.name, IPT_STANDARD_TARGET)) {
+ struct xt_standard_target *t;
+ t = (struct xt_standard_target *)target;
+ if (t->verdict == 0)
+ return true;
+ }
return false;
}