From 2bf9dd8eed8df911ad02353428f9688ece23ec4e Mon Sep 17 00:00:00 2001 From: Florian Obser Date: Fri, 13 Sep 2013 14:32:54 +0000 Subject: pflow(4) does not work without flowsrc set. OK benno@ --- sbin/ifconfig/ifconfig.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'sbin/ifconfig/ifconfig.c') 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); } -- cgit v1.2.3