From nobody Tue Nov 09 15:36:08 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 49FFA18489B9; Tue, 9 Nov 2021 15:36:09 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpXBc6Gz9z4thy; Tue, 9 Nov 2021 15:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C45026EF9; Tue, 9 Nov 2021 15:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9Fa8uU000102; Tue, 9 Nov 2021 15:36:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9Fa8FW000101; Tue, 9 Nov 2021 15:36:08 GMT (envelope-from git) Date: Tue, 9 Nov 2021 15:36:08 GMT Message-Id: <202111091536.1A9Fa8FW000101@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 64acb29b7d96 - main - sockstat: change check for wildcard sockets to avoid historical classes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 64acb29b7d9699c301a55a5431d94374391e4f30 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=64acb29b7d9699c301a55a5431d94374391e4f30 commit 64acb29b7d9699c301a55a5431d94374391e4f30 Author: Mike Karels AuthorDate: 2021-10-27 03:12:24 +0000 Commit: Mike Karels CommitDate: 2021-11-09 15:34:44 +0000 sockstat: change check for wildcard sockets to avoid historical classes sockstat was checking whether a bound address was "host 0", the lowest host on a network, using inet_lnaof(). This only works for class A/B/C. However, it isn't useful to bind such an address unless it is really the unspecified address INADDR_ANY. Change the check to to use that. MFC after: 1 month Reviewd by: tuexen Differential Revision: https://reviews.freebsd.org/D32715 --- usr.bin/sockstat/sockstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index d7fdb87b7490..1a4413116a79 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -874,7 +874,7 @@ printaddr(struct sockaddr_storage *ss) switch (ss->ss_family) { case AF_INET: - if (inet_lnaof(sstosin(ss)->sin_addr) == INADDR_ANY) + if (sstosin(ss)->sin_addr.s_addr == INADDR_ANY) addrstr[0] = '*'; port = ntohs(sstosin(ss)->sin_port); break;