diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-02-23 18:27:08 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-12-30 23:50:26 +0100 |
commit | 3f7877e6be987bb94897c03a45945725389a6f5c (patch) | |
tree | 6000a614aa23fa8c89b2ba13c10d758c11f18815 /iptables/xtables.c | |
parent | 077785df023ad8947d44d19769bc6d91e3917633 (diff) |
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 <pablo@netfilter.org>
Diffstat (limited to 'iptables/xtables.c')
-rw-r--r-- | iptables/xtables.c | 5 |
1 files changed, 4 insertions, 1 deletions
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"); |