summaryrefslogtreecommitdiffstats
path: root/iptables/iptables.c
diff options
context:
space:
mode:
Diffstat (limited to 'iptables/iptables.c')
-rw-r--r--iptables/iptables.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/iptables/iptables.c b/iptables/iptables.c
index 428fae4e..31cb97b2 100644
--- a/iptables/iptables.c
+++ b/iptables/iptables.c
@@ -535,7 +535,6 @@ print_firewall(const struct ipt_entry *fw,
struct xtables_target *target, *tg;
const struct xt_entry_target *t;
uint8_t flags;
- char buf[BUFSIZ];
if (!iptc_is_chain(targname, handle))
target = xtables_find_target(targname, XTF_TRY_LOAD);
@@ -604,29 +603,7 @@ print_firewall(const struct ipt_entry *fw,
printf(FMT("%-6s ","out %s "), iface);
}
- fputc(fw->ip.invflags & IPT_INV_SRCIP ? '!' : ' ', stdout);
- if (fw->ip.smsk.s_addr == 0L && !(format & FMT_NUMERIC))
- printf(FMT("%-19s ","%s "), "anywhere");
- else {
- if (format & FMT_NUMERIC)
- strcpy(buf, xtables_ipaddr_to_numeric(&fw->ip.src));
- else
- strcpy(buf, xtables_ipaddr_to_anyname(&fw->ip.src));
- strcat(buf, xtables_ipmask_to_numeric(&fw->ip.smsk));
- printf(FMT("%-19s ","%s "), buf);
- }
-
- fputc(fw->ip.invflags & IPT_INV_DSTIP ? '!' : ' ', stdout);
- if (fw->ip.dmsk.s_addr == 0L && !(format & FMT_NUMERIC))
- printf(FMT("%-19s ","-> %s"), "anywhere");
- else {
- if (format & FMT_NUMERIC)
- strcpy(buf, xtables_ipaddr_to_numeric(&fw->ip.dst));
- else
- strcpy(buf, xtables_ipaddr_to_anyname(&fw->ip.dst));
- strcat(buf, xtables_ipmask_to_numeric(&fw->ip.dmsk));
- printf(FMT("%-19s ","-> %s"), buf);
- }
+ print_ipv4_addresses(fw, format);
if (format & FMT_NOTABLE)
fputs(" ", stdout);