From owner-svn-src-all@freebsd.org Fri Jul 17 19:07:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 097FB36C364; Fri, 17 Jul 2020 19:07:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B7gcL3NKQz4PhH; Fri, 17 Jul 2020 19:07:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA10A1E0A0; Fri, 17 Jul 2020 19:07:44 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06HJ7ibv015894; Fri, 17 Jul 2020 19:07:44 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06HJ7imv015893; Fri, 17 Jul 2020 19:07:44 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202007171907.06HJ7imv015893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 17 Jul 2020 19:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363280 - in head/contrib/ipfilter: man tools X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/contrib/ipfilter: man tools X-SVN-Commit-Revision: 363280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 19:07:47 -0000 Author: cy Date: Fri Jul 17 19:07:44 2020 New Revision: 363280 URL: https://svnweb.freebsd.org/changeset/base/363280 Log: ipfstat -t defaults to IPv4 output. Make consistent with ipfstat -i and ipfstat -o where without an argument IPv4 and IPv6 states are shown. Use -4 and -6 to limit the display to IPv4 or IPv6 respectively. PR: 247952 MFC after: 1 week Modified: head/contrib/ipfilter/man/ipfstat.8 head/contrib/ipfilter/tools/ipfstat.c Modified: head/contrib/ipfilter/man/ipfstat.8 ============================================================================== --- head/contrib/ipfilter/man/ipfstat.8 Fri Jul 17 19:07:40 2020 (r363279) +++ head/contrib/ipfilter/man/ipfstat.8 Fri Jul 17 19:07:44 2020 (r363280) @@ -195,4 +195,5 @@ more entries is to resize the screen. .SH SEE ALSO ipf(8) .SH BUGS -\fB-4\fP and \fB-6\fP should also be the default when displaying states. +\fB-4\fP and \fB-6\fP are only valid with \fB-i\fP, \fB-o\fP, and \fB-t\fP. +An error should result when used with other arguments. Modified: head/contrib/ipfilter/tools/ipfstat.c ============================================================================== --- head/contrib/ipfilter/tools/ipfstat.c Fri Jul 17 19:07:40 2020 (r363279) +++ head/contrib/ipfilter/tools/ipfstat.c Fri Jul 17 19:07:44 2020 (r363280) @@ -421,9 +421,9 @@ int main(argc,argv) else if (opts & OPT_STATETOP) topipstates(saddr, daddr, sport, dport, protocol, #ifdef USE_INET6 - use_inet6 && !use_inet4 ? 6 : 4, + use_inet6 && use_inet4 ? 0 : use_inet6 && !use_inet4 ? 6 : 4, #else - 4, + 4, #endif #endif refreshtime, topclosed, filter); @@ -1367,7 +1367,7 @@ static void topipstates(saddr, daddr, sport, dport, pr if (ipsstp->iss_list == NULL) break; - if (ips.is_v != ver) + if (ver != 0 && ips.is_v != ver) continue; if ((filter != NULL) &&