diff options
author | Phil Sutter <phil@nwl.cc> | 2021-10-21 03:00:57 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2021-12-16 14:30:29 +0100 |
commit | 4149b5d836340c744c78f303e2a877a89c271000 (patch) | |
tree | aeffada86fc432b9d03e8b1867a0a949d2060362 /iptables/iptables.c | |
parent | 273d88a7744ea5638969ad3252acf518e5ec6cc2 (diff) |
xshared: Share print_match_save() between legacy ip*tables
The only difference between the former two copies was the type of
ip*_entry parameter. But since it is treated opaque, just hide that
detail by casting to void.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/iptables.c')
-rw-r--r-- | iptables/iptables.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/iptables/iptables.c b/iptables/iptables.c index ac51c612..a69d4238 100644 --- a/iptables/iptables.c +++ b/iptables/iptables.c @@ -642,37 +642,6 @@ list_entries(const xt_chainlabel chain, int rulenum, int verbose, int numeric, #define IP_PARTS(n) IP_PARTS_NATIVE(ntohl(n)) -static int print_match_save(const struct xt_entry_match *e, - const struct ipt_ip *ip) -{ - const char *name = e->u.user.name; - const int revision = e->u.user.revision; - struct xtables_match *match, *mt, *mt2; - - match = xtables_find_match(name, XTF_TRY_LOAD, NULL); - if (match) { - mt = mt2 = xtables_find_match_revision(name, XTF_TRY_LOAD, - match, revision); - if (!mt2) - mt2 = match; - printf(" -m %s", mt2->alias ? mt2->alias(e) : name); - - /* some matches don't provide a save function */ - if (mt && mt->save) - mt->save(ip, e); - else if (match->save) - printf(unsupported_rev); - } else { - if (e->u.match_size) { - fprintf(stderr, - "Can't find library for match `%s'\n", - name); - exit(1); - } - } - return 0; -} - /* We want this to be readable, so only print out necessary fields. * Because that's the kind of world I want to live in. */ |