diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2013-09-13 14:32:54 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2013-09-13 14:32:54 +0000 |
commit | 2bf9dd8eed8df911ad02353428f9688ece23ec4e (patch) | |
tree | c7bc6360dc56d35b6336b7ad15a542fc428af179 /sbin/ifconfig/ifconfig.c | |
parent | 84ff63dd52748e5ee819b9481c56c90eeb55c65c (diff) |
pflow(4) does not work without flowsrc set.
OK benno@
Diffstat (limited to 'sbin/ifconfig/ifconfig.c')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index da03a752093..99f4f7e910b 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.269 2013/08/19 11:20:57 dcoppa Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.270 2013/09/13 14:32:53 florian Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -3808,9 +3808,14 @@ pflow_status(void) if (ioctl(s, SIOCGETPFLOW, (caddr_t)&ifr) == -1) return; - printf("\tpflow: sender: %s ", inet_ntoa(preq.sender_ip)); - printf("receiver: %s:%u ", inet_ntoa(preq.receiver_ip), - ntohs(preq.receiver_port)); + printf("\tpflow: sender: %s ", preq.sender_ip.s_addr != INADDR_ANY ? + inet_ntoa(preq.sender_ip) : "INVALID"); + printf("receiver: %s:", preq.receiver_ip.s_addr != INADDR_ANY ? + inet_ntoa(preq.receiver_ip) : "INVALID"); + if (preq.receiver_port == 0) + printf("%s ", "INVALID"); + else + printf("%u ", ntohs(preq.receiver_port)); printf("version: %d\n", preq.version); } |