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)
+ connman_iptables_globals.opts =
+ xtables_options_xfrm(
+#if XTABLES_VERSION_CODE > 5
+ connman_iptables_globals.orig_opts,
+#endif
+ connman_iptables_globals.opts,
+ xt_m->x6_options,
+ &xt_m->option_offset);
+ else
connman_iptables_globals.opts =
xtables_merge_options(
#if XTABLES_VERSION_CODE > 5
xt_m->extra_opts,
&xt_m->option_offset);
- if (connman_iptables_globals.opts == NULL) {
- g_free(xt_m->m);
- xt_m = NULL;
- }
+ if (connman_iptables_globals.opts == NULL) {
+ g_free(xt_m->m);
+ xt_m = NULL;
}
+done:
return xt_m;
}