if (!ctx)
return -ENOMEM;
- /* could probe here. However, this means that we will load
- * iptable_nat or nf_tables, both will enable connection tracking.
- *
- * Alternative would be to probe here but only call
- * fw_ctx_new when nspawn/networkd know they will call
- * fw_add_masquerade/local_dnat later anyway.
- */
-
*ctx = (FirewallContext) {
.backend = _FW_BACKEND_INVALID,
};
+ firewall_backend_probe(ctx);
+
*ret = TAKE_PTR(ctx);
return 0;
}
return r;
}
- firewall_backend_probe(*ctx);
-
switch ((*ctx)->backend) {
#if HAVE_LIBIPTC
case FW_BACKEND_IPTABLES:
return r;
}
- firewall_backend_probe(*ctx);
-
switch ((*ctx)->backend) {
#if HAVE_LIBIPTC
case FW_BACKEND_IPTABLES: