From 3f7877e6be987bb94897c03a45945725389a6f5c Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sat, 23 Feb 2013 18:27:08 +0100 Subject: xtables-restore: add -4 and -6 support Now you can specify: xtables-restore -6 < my-ip6tables-ruleset to restore the IPv6 rule-set. Signed-off-by: Pablo Neira Ayuso --- iptables/xtables.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'iptables/xtables.c') diff --git a/iptables/xtables.c b/iptables/xtables.c index c3110558..c0a6347a 100644 --- a/iptables/xtables.c +++ b/iptables/xtables.c @@ -1247,7 +1247,10 @@ int do_commandx(struct nft_handle *h, int argc, char *argv[], char **table) break; } - h->family = family; + /* Set only if required, needed by xtables-restore */ + if (h->family == AF_UNSPEC) + h->family = family; + h->ops = nft_family_ops_lookup(family); if (h->ops == NULL) xtables_error(PARAMETER_PROBLEM, "Unknown family"); -- cgit v1.2.3