diff options
author | Phil Sutter <phil@nwl.cc> | 2018-08-06 17:21:57 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-08-06 18:17:39 +0200 |
commit | 63c3dae305cf27cabe5577da5599ddc26f4af36c (patch) | |
tree | 726900fb286b0a55f8356ab6e1ed2653dcf1c1eb /iptables/xtables-arp-standalone.c | |
parent | aa7fb04fcf72cf50ba6c490ae1cae30181672004 (diff) | |
download | iptables-63c3dae305cf27cabe5577da5599ddc26f4af36c.tar.gz |
xtables: Implement arptables-{save,restore}
This adds C implementations for arptables-save and -restore in compat
layer based on the two perl scripts in legacy arptables repository.
To share common code, introduce nft_init_arp() analogous to
nft_init_eb() introduced earlier.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/xtables-arp-standalone.c')
-rw-r--r-- | iptables/xtables-arp-standalone.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/iptables/xtables-arp-standalone.c b/iptables/xtables-arp-standalone.c index 6553d28f..eca7bb97 100644 --- a/iptables/xtables-arp-standalone.c +++ b/iptables/xtables-arp-standalone.c @@ -47,24 +47,11 @@ int xtables_arp_main(int argc, char *argv[]) { int ret; char *table = "filter"; - struct nft_handle h = { - .family = NFPROTO_ARP, - }; + struct nft_handle h; - arptables_globals.program_name = "arptables"; - ret = xtables_init_all(&arptables_globals, NFPROTO_ARP); - if (ret < 0) { - fprintf(stderr, "%s/%s Failed to initialize arptables-compat\n", - arptables_globals.program_name, - arptables_globals.program_version); - exit(1); - } + nft_init_arp(&h, "arptables"); -#if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS) - init_extensionsa(); -#endif - - ret = do_commandarp(&h, argc, argv, &table); + ret = do_commandarp(&h, argc, argv, &table, false); if (ret) ret = nft_commit(&h); |