diff options
author | 2013-09-13 14:32:52 +0000 | |
---|---|---|
committer | 2013-09-13 14:32:52 +0000 | |
commit | 1a28b959583b057d1f64ccd5a0936af9d8e620d5 (patch) | |
tree | 70b70a0289899ce2609bf013bd9baf8097566fbd | |
parent | Don't send flows if flowsrc is not set. Packages had a broken (diff) | |
download | wireguard-openbsd-1a28b959583b057d1f64ccd5a0936af9d8e620d5.tar.xz wireguard-openbsd-1a28b959583b057d1f64ccd5a0936af9d8e620d5.zip |
pflow(4) does not work without flowsrc set.
OK benno@
-rw-r--r-- | sbin/ifconfig/ifconfig.8 | 7 | ||||
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 13 | ||||
-rw-r--r-- | share/man/man4/pflow.4 | 10 |
3 files changed, 19 insertions, 11 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 9e436602579..13f3e7a2b9b 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ifconfig.8,v 1.234 2013/05/31 19:56:06 yasuoka Exp $ +.\" $OpenBSD: ifconfig.8,v 1.235 2013/09/13 14:32:52 florian Exp $ .\" $NetBSD: ifconfig.8,v 1.11 1996/01/04 21:27:29 pk Exp $ .\" $FreeBSD: ifconfig.8,v 1.16 1998/02/01 07:03:29 steve Exp $ .\" @@ -31,7 +31,7 @@ .\" .\" @(#)ifconfig.8 8.4 (Berkeley) 6/1/94 .\" -.Dd $Mdocdate: May 31 2013 $ +.Dd $Mdocdate: September 13 2013 $ .Dt IFCONFIG 8 .Os .Sh NAME @@ -1224,11 +1224,12 @@ Pflow data will be sent to this address/port. Unset the receiver address and stop sending pflow data. .It Cm flowsrc Ar addr Set the source IP address for pflow packets. +Must be defined to export pflow data. .Ar addr is the IP address used as sender of the UDP packets and may be used to identify the source of the data on the pflow collector. .It Fl flowsrc -Unset the source address. +Unset the source address and stop sending pflow data. .It Cm pflowproto Ar n Set the protocol version. The default is version 5. 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); } diff --git a/share/man/man4/pflow.4 b/share/man/man4/pflow.4 index 8b0e74b8b75..99b4dfe45e3 100644 --- a/share/man/man4/pflow.4 +++ b/share/man/man4/pflow.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pflow.4,v 1.14 2012/10/30 12:09:05 florian Exp $ +.\" $OpenBSD: pflow.4,v 1.15 2013/09/13 14:32:53 florian Exp $ .\" .\" Copyright (c) 2008 Henning Brauer <henning@openbsd.org> .\" Copyright (c) 2008 Joerg Goltermann <jg@osn.de> @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: October 30 2012 $ +.Dd $Mdocdate: September 13 2013 $ .Dt PFLOW 4 .Os .Sh NAME @@ -42,8 +42,8 @@ Multiple interfaces can be created at runtime using the .Ic ifconfig pflow Ns Ar N Ic create command. -Each interface must be configured with a flow receiver IP address and -port number. +Each interface must be configured with flow sender IP address and a flow +receiver IP address and port number. .Pp Only states created by a rule marked with the .Ar pflow @@ -91,6 +91,8 @@ collector. .Cm flowdst defines the collector IP address and the port. The +.Cm flowsrc +IP address and .Cm flowdst IP address and port must be defined to enable the export of flows. .Pp |