diff options
author | giovanni <giovanni@cvs.openbsd.org> | 2010-07-22 12:33:30 +0000 |
---|---|---|
committer | giovanni <giovanni@cvs.openbsd.org> | 2010-07-22 12:33:30 +0000 |
commit | 38330b34c0075cb10bbf547792b6d64cd4c1f4b5 (patch) | |
tree | b9556ce08ac8803c4a611e3366abb1d22f1b4a0a /usr.bin/systat/pftop.c | |
parent | 0bcff2706bc6931365c94b616ccefb734b555dbc (diff) |
Let systat -N states resolve network addresses
help and ok sthen@ lum@
ok canacar@
Diffstat (limited to 'usr.bin/systat/pftop.c')
-rw-r--r-- | usr.bin/systat/pftop.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/usr.bin/systat/pftop.c b/usr.bin/systat/pftop.c index 8b2b3f938b2..8d67757f8c3 100644 --- a/usr.bin/systat/pftop.c +++ b/usr.bin/systat/pftop.c @@ -1,4 +1,4 @@ -/* $Id: pftop.c,v 1.14 2009/11/23 21:30:14 henning Exp $ */ +/* $Id: pftop.c,v 1.15 2010/07/22 12:33:29 giovanni Exp $ */ /* * Copyright (c) 2001, 2007 Can Erkin Acar * Copyright (c) 2001 Daniel Hartmeier @@ -708,11 +708,16 @@ unmask(struct pf_addr * m, u_int8_t af) void tb_print_addr(struct pf_addr * addr, struct pf_addr * mask, int af) { - static char buf[48]; - const char *bf; - - bf = inet_ntop(af, addr, buf, sizeof(buf)); - tbprintf("%s", bf); + switch (af) { + case AF_INET: { + tbprintf("%s", inetname(addr->v4)); + break; + } + case AF_INET6: { + tbprintf("%s", inet6name(&addr->v6)); + break; + } + } if (mask != NULL) { if (!PF_AZERO(mask, af)) |