diff --git a/src/nspawn/nspawn-expose-ports.c b/src/nspawn/nspawn-expose-ports.c index d8a37a3399..d1e29d7b82 100644 --- a/src/nspawn/nspawn-expose-ports.c +++ b/src/nspawn/nspawn-expose-ports.c @@ -100,9 +100,6 @@ int expose_port_flush(ExposePort* l, union in_addr_union *exposed) { r = fw_add_local_dnat(false, af, p->protocol, - NULL, - NULL, 0, - NULL, 0, p->host_port, exposed, p->container_port, @@ -156,9 +153,6 @@ int expose_port_execute(sd_netlink *rtnl, ExposePort *l, union in_addr_union *ex r = fw_add_local_dnat(true, af, p->protocol, - NULL, - NULL, 0, - NULL, 0, p->host_port, &new_exposed, p->container_port, diff --git a/src/shared/firewall-util.c b/src/shared/firewall-util.c index 007d2cb39b..bcef7602ce 100644 --- a/src/shared/firewall-util.c +++ b/src/shared/firewall-util.c @@ -158,11 +158,6 @@ int fw_add_local_dnat( bool add, int af, int protocol, - const char *in_interface, - const union in_addr_union *source, - unsigned source_prefixlen, - const union in_addr_union *destination, - unsigned destination_prefixlen, uint16_t local_port, const union in_addr_union *remote, uint16_t remote_port, @@ -177,6 +172,11 @@ int fw_add_local_dnat( struct nf_nat_ipv4_multi_range_compat *mr; size_t sz, msz; int r; + const char *in_interface = NULL; + const union in_addr_union *source = NULL; + unsigned source_prefixlen = 0; + const union in_addr_union *destination = NULL; + unsigned destination_prefixlen = 0; assert(add || !previous_remote); diff --git a/src/shared/firewall-util.h b/src/shared/firewall-util.h index 0a51a3c692..01a3c8a846 100644 --- a/src/shared/firewall-util.h +++ b/src/shared/firewall-util.h @@ -22,11 +22,6 @@ int fw_add_local_dnat( bool add, int af, int protocol, - const char *in_interface, - const union in_addr_union *source, - unsigned source_prefixlen, - const union in_addr_union *destination, - unsigned destination_prefixlen, uint16_t local_port, const union in_addr_union *remote, uint16_t remote_port, @@ -50,11 +45,6 @@ static inline int fw_add_local_dnat( bool add, int af, int protocol, - const char *in_interface, - const union in_addr_union *source, - unsigned source_prefixlen, - const union in_addr_union *destination, - unsigned destination_prefixlen, uint16_t local_port, const union in_addr_union *remote, uint16_t remote_port, diff --git a/src/test/test-firewall-util.c b/src/test/test-firewall-util.c index 64616e4391..479669fe45 100644 --- a/src/test/test-firewall-util.c +++ b/src/test/test-firewall-util.c @@ -22,19 +22,19 @@ int main(int argc, char *argv[]) { if (r < 0) log_error_errno(r, "Failed to modify firewall: %m"); - r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, NULL, NULL, 0, NULL, 0, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 4), 815, NULL); + r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 4), 815, NULL); if (r < 0) log_error_errno(r, "Failed to modify firewall: %m"); - r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, NULL, NULL, 0, NULL, 0, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 4), 815, NULL); + r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 4), 815, NULL); if (r < 0) log_error_errno(r, "Failed to modify firewall: %m"); - r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, NULL, NULL, 0, NULL, 0, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 5), 815, &MAKE_IN_ADDR_UNION(1, 2, 3, 4)); + r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 5), 815, &MAKE_IN_ADDR_UNION(1, 2, 3, 4)); if (r < 0) log_error_errno(r, "Failed to modify firewall: %m"); - r = fw_add_local_dnat(false, AF_INET, IPPROTO_TCP, NULL, NULL, 0, NULL, 0, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 5), 815, NULL); + r = fw_add_local_dnat(false, AF_INET, IPPROTO_TCP, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 5), 815, NULL); if (r < 0) log_error_errno(r, "Failed to modify firewall: %m");