From 8da04ffdca1931402a6bc22c43c1a2fa1c6f1e14 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 19 Sep 2018 15:16:59 +0200 Subject: Share print_ipv{4,6}_addr() from xtables These functions contain code which occurs in legacy's print_firewall() functions, so use them there. Rename them to at least make clear they print more than a single address. Also introduce ipv{4,6}_addr_to_string() which take care of converting an address/netmask pair into string representation in a way which doesn't upset covscan (since that didn't detect that 'buf' may not be exceeded by the strings written into it. Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal --- iptables/xshared.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'iptables/xshared.h') diff --git a/iptables/xshared.h b/iptables/xshared.h index 801d0f75..cb6f761d 100644 --- a/iptables/xshared.h +++ b/iptables/xshared.h @@ -168,4 +168,7 @@ void free_argv(void); void save_argv(void); void add_param_to_argv(char *parsestart, int line); +void print_ipv4_addresses(const struct ipt_entry *fw, unsigned int format); +void print_ipv6_addresses(const struct ip6t_entry *fw6, unsigned int format); + #endif /* IPTABLES_XSHARED_H */ -- cgit v1.2.3