diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2011-10-27 10:26:36 +0300 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-10-28 21:34:28 +0200 |
commit | f090f0ed598871d3013761aedc24d7a57c5e5c13 (patch) | |
tree | 71abec2d3d730a144b33a6432b8bb5e5c1664cd5 /src | |
parent | 78f2312d70e4cd008d4fd4666f40d953089c4fb6 (diff) | |
download | connman-f090f0ed598871d3013761aedc24d7a57c5e5c13.tar.gz connman-f090f0ed598871d3013761aedc24d7a57c5e5c13.tar.bz2 connman-f090f0ed598871d3013761aedc24d7a57c5e5c13.zip |
iptables: Add x6_options matches handling
Diffstat (limited to 'src')
-rw-r--r-- | src/iptables.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/iptables.c b/src/iptables.c index 5a90be79..417c937b 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -1349,8 +1349,20 @@ static struct xtables_match *prepare_matches(struct connman_iptables *table, if (xt_m->init != NULL) xt_m->init(xt_m->m); - if (xt_m != xt_m->next) { + if (xt_m == xt_m->next) + goto done; + + if (xt_m->x6_options != NULL) iptables_globals.opts = + xtables_options_xfrm( +#if XTABLES_VERSION_CODE > 5 + iptables_globals.orig_opts, +#endif + iptables_globals.opts, + xt_m->x6_options, + &xt_m->option_offset); + else + iptables_globals.opts = xtables_merge_options( #if XTABLES_VERSION_CODE > 5 iptables_globals.orig_opts, @@ -1359,12 +1371,12 @@ static struct xtables_match *prepare_matches(struct connman_iptables *table, xt_m->extra_opts, &xt_m->option_offset); - if (iptables_globals.opts == NULL) { - g_free(xt_m->m); - xt_m = NULL; - } + if (iptables_globals.opts == NULL) { + g_free(xt_m->m); + xt_m = NULL; } +done: return xt_m; } |