From e5fb9f8efaa0643a566d079c8201082822a0dc81 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 5 Nov 2021 18:50:21 +0100 Subject: xshared: Share save_ipv{4,6}_addr() with legacy While being at it, make save_ipv4_addr() accept an in_addr* as mask - mask_to_str() needs it anyway. Signed-off-by: Phil Sutter --- iptables/nft-ipv6.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'iptables/nft-ipv6.c') diff --git a/iptables/nft-ipv6.c b/iptables/nft-ipv6.c index 0c73cedd..0b35e045 100644 --- a/iptables/nft-ipv6.c +++ b/iptables/nft-ipv6.c @@ -224,26 +224,6 @@ static void nft_ipv6_print_rule(struct nft_handle *h, struct nftnl_rule *r, nft_clear_iptables_command_state(&cs); } -static void save_ipv6_addr(char letter, const struct in6_addr *addr, - const struct in6_addr *mask, - int invert) -{ - char addr_str[INET6_ADDRSTRLEN]; - int l = xtables_ip6mask_to_cidr(mask); - - if (!invert && l == 0) - return; - - printf("%s -%c %s", - invert ? " !" : "", letter, - inet_ntop(AF_INET6, addr, addr_str, sizeof(addr_str))); - - if (l == -1) - printf("/%s", inet_ntop(AF_INET6, mask, addr_str, sizeof(addr_str))); - else - printf("/%d", l); -} - static void nft_ipv6_save_rule(const void *data, unsigned int format) { const struct iptables_command_state *cs = data; -- cgit v1.2.3