From 0e4420ace73a231c30ca8fadc115941c6a46bdd5 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Thu, 10 Oct 2019 18:39:11 +0000 Subject: [PATCH] MFS r353402: In r343587 a simple port filter as sysctl tunable was added to siftr. The new sysctl was not added to the siftr.4 man page at the time. This updates the man page, and removes one left over trailing whitespace. Submitted by: Richard Scheffenegger Differential Revision: https://reviews.freebsd.org/D21619 Reviewed by: bcr@ Approved by: re (gjb@) --- share/man/man4/siftr.4 | 10 +++++++++- sys/netinet/siftr.c | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/share/man/man4/siftr.4 b/share/man/man4/siftr.4 index e122b5cdd35..1475a088483 100644 --- a/share/man/man4/siftr.4 +++ b/share/man/man4/siftr.4 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2015 +.Dd October 7, 2019 .Dt SIFTR 4 .Os .Sh NAME @@ -131,6 +131,14 @@ The hashes are useful to correlate which TCP packet triggered the generation of a particular log message, but calculating them adds additional computational overhead into the fast path. .El +.Bl -tag -offset indent -width Va +.It Va net.inet.siftr.port_filter +controls on which source or destination port siftr should capture +.Nm . +By default, the value is set to 0, which means all ports are eligible for logging. +Set to any other value, only packets where either the source or destination +port is equal to this number are logged. +.El .Ss Log Format A typical .Nm diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c index 4d063c36038..7fa97bec18f 100644 --- a/sys/netinet/siftr.c +++ b/sys/netinet/siftr.c @@ -916,7 +916,7 @@ siftr_chkpkt(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, * Only pkts selected by the tcp port filter * can be inserted into the pkt_queue */ - if ((siftr_port_filter != 0) && + if ((siftr_port_filter != 0) && (siftr_port_filter != ntohs(inp->inp_lport)) && (siftr_port_filter != ntohs(inp->inp_fport))) { goto inp_unlock; -- 2.45.0