From nobody Fri Dec 10 16:29:16 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 A870A18D6B1F; Fri, 10 Dec 2021 16:29:18 +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 4J9bvd1SwJz3FDs; Fri, 10 Dec 2021 16:29:17 +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 994BC1DA4A; Fri, 10 Dec 2021 16:29:16 +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 1BAGTGtX077035; Fri, 10 Dec 2021 16:29:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BAGTGNP077034; Fri, 10 Dec 2021 16:29:16 GMT (envelope-from git) Date: Fri, 10 Dec 2021 16:29:16 GMT Message-Id: <202112101629.1BAGTGNP077034@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mike Karels Subject: git: 5abf4c8aa762 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 5abf4c8aa7623528aa89889af6a44d45b489df9d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639153757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sZZ5sowR5iknQy+3ZZQOmkP6eWSWcu5/b+HND59pCX0=; b=r6uOtZOxaVX6teMm2AmJxvijn1aIyqn7sc+l8v2ZF2vHb0UmTR72MTODkPvuRhhaKrT3L5 qqLsU9jySlXaRi2NA4icddYg7nIjrG3fk/HPKG0qkJHSu6pTl7lfw4zF5gC68DtEU4XsHQ 179Dw5+0KpdW0KoJiJEgMj9wZi4eu7S+caN7pz3/Cyagy0kehP5/E8gxW+g8TRY25bF7TJ 8YGzdy6XGl12lFrFICSc3irqOZiCvuHlYuWQqlA4xWpFZt4QS9D1Y3pypICaywrLp38gGG kjcFWanKdYBIyliJcyfFOQ73SjWWDIufVQxjqV5wz5mXPWbj5lXpnZ+FVlHsFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639153757; a=rsa-sha256; cv=none; b=dKuF35e9sN0ggdEhZ4jxczlO470ig1wV0yjC16sASvBdzwTS43c+IoLrzPc4IQquZrCis3 YX4rFwp2IimvTK/DYlf2wr9sYmFaWT5OwbLS0+V/AVJTEuXNv3VZ/5W+6h8pXUpLiD2lqn BF9m+mMRynxHgK+ii2wIInkWMIFNHN4I81/iCoMOaH4dMn9/ZMnQeAqWk7nFEVq7jzksmU 6vaV+Rs5dqlVWPXgFRwMXEBZnB474QArB+Y9DfdR5t94h3aQ/MW/LgBGiqLMdKdqHOMvTA Qd/IAfVJNuk9sLwcIzm8Hp+EI2lzsLjtoSTGcBvajAq5aPHSYzuUEQ6bSd5J0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=5abf4c8aa7623528aa89889af6a44d45b489df9d commit 5abf4c8aa7623528aa89889af6a44d45b489df9d Author: Mike Karels AuthorDate: 2021-10-27 03:12:24 +0000 Commit: Mike Karels CommitDate: 2021-12-10 16:27:24 +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. (cherry picked from commit 64acb29b7d9699c301a55a5431d94374391e4f30) --- 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 109b254b7438..6edb589b5209 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -856,7 +856,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;