summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--iptables/nft-shared.h2
-rw-r--r--iptables/xtables.c15
2 files changed, 6 insertions, 11 deletions
diff --git a/iptables/nft-shared.h b/iptables/nft-shared.h
index 71094a28..44ad0811 100644
--- a/iptables/nft-shared.h
+++ b/iptables/nft-shared.h
@@ -177,6 +177,7 @@ struct addr_mask {
union {
struct in_addr *v4;
struct in6_addr *v6;
+ void *ptr;
} addr;
unsigned int naddrs;
@@ -184,6 +185,7 @@ struct addr_mask {
union {
struct in_addr *v4;
struct in6_addr *v6;
+ void *ptr;
} mask;
};
diff --git a/iptables/xtables.c b/iptables/xtables.c
index 092edaaf..f45e3608 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -1021,17 +1021,10 @@ int do_commandx(struct nft_handle *h, int argc, char *argv[], char **table,
nft_clear_iptables_command_state(&cs);
- if (h->family == AF_INET) {
- free(args.s.addr.v4);
- free(args.s.mask.v4);
- free(args.d.addr.v4);
- free(args.d.mask.v4);
- } else if (h->family == AF_INET6) {
- free(args.s.addr.v6);
- free(args.s.mask.v6);
- free(args.d.addr.v6);
- free(args.d.mask.v6);
- }
+ free(args.s.addr.ptr);
+ free(args.s.mask.ptr);
+ free(args.d.addr.ptr);
+ free(args.d.mask.ptr);
xtables_free_opts(1);
return ret;