From nobody Thu Sep 28 15:52:49 2023 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 4RxJ0L19nFz4tyX8; Thu, 28 Sep 2023 15:52:50 +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 4RxJ0K5lMYz4Lhj; Thu, 28 Sep 2023 15:52:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695916369; 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=mO3eviVT0VufjxjbqS0cJHiF54RsqtTWcaV0dQaHhp4=; b=ive3wi52OKTVKTb3oG8rgVmZVyuXWE0ypmdGJXAwyin8cQJ2Wczsz6bcX3Gdz66h10uQI3 lsnXK8DUk/RFJLpmQsaTorDCs5kNC9TUd/1mpRXT7rxOWxSJjPjrSu5eW3GkTL37uwBIHs cjOPyKzQSCMvVrxPaOiH1nykfURYOIJGPyeK9bC062X3hMt1uM0ubGrUSxCzVA7ldmICwO bo7+St7EwT3LXbaBu9hmwYVd7RfQvnyviuRMeW11VPCXe7+bbUxdApZEtT7MdrOogxWhZ9 seQCDiC1qg86U/PupGcOxKzWeC5txJrWp8irutCoUY+IwtGTYR8EhNatADuEjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695916369; a=rsa-sha256; cv=none; b=fDYbe2l1ethcKb6Ylcczr1wGwiHC0FMhhiqFEvBNtsE3LHFUCcImX9NNGdoghBoXtcIP6T nVExHtq6/WCBiQElLiHBagO5MYkFya02bBhFvhSjEKuX3kx6GvyuJb/bn+5/psRFaNkErZ cYq7woGE4IqSj5Wj4NlSC0lLkKW0DWPYqra6j6iVGjvo25fqY2rtvVIisiosC/JRLFFL1r SUyKN6l+nE/wEh4c5TzNNUc/6KOJaawe5zerp04hFMfjPf8DS/oKoa71KCaOfWTfGc0lPJ 3C6QI9hBOfvG9JKoyinl2iFML0pIeJjZallDZth4C6CJ/fUpBHOHjcgHvNg5Aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695916369; 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=mO3eviVT0VufjxjbqS0cJHiF54RsqtTWcaV0dQaHhp4=; b=fi64AHGN+hgRgTATtjoHz8lM1vqpElQuxonRmIQE2xCdYj6f/r7/7xbJmbRlccl0DA7iYp tL+S0eAy79n0ghneW3H1ctoOYEPznZGNfBQO7VZ5LhANSU5fcKB2SdhXmGMCu0Xwk4rY52 a4RhFNbLQgvgogQ2Rd6wL56eWi/zO/Y01KscX3R66NOSnLljfWYALLQKd/1FJjUI/1mbxe +68WsSIRPdWNudjRrnK0TGHV/LWi3gs9ZJjxniefJ4aUB7Rxr9xbObUgz37UF36yWMDFHI H8PiaIkjm5JbzbfNy2eJ2v7Yrst6O+tfU/8/7e4P5xc74s7cN30Od9O7Nc8sHA== 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 4RxJ0K4rqkzDLD; Thu, 28 Sep 2023 15:52:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38SFqnjV022643; Thu, 28 Sep 2023 15:52:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38SFqn9a022640; Thu, 28 Sep 2023 15:52:49 GMT (envelope-from git) Date: Thu, 28 Sep 2023 15:52:49 GMT Message-Id: <202309281552.38SFqn9a022640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 94cae4cb339a - main - syslogd: Do not add shutdown sockets to the kqueue 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94cae4cb339a839b9f9a1b35226de06271017b25 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=94cae4cb339a839b9f9a1b35226de06271017b25 commit 94cae4cb339a839b9f9a1b35226de06271017b25 Author: Jake Freeland AuthorDate: 2023-09-01 02:51:33 +0000 Commit: Mark Johnston CommitDate: 2023-09-28 15:51:54 +0000 syslogd: Do not add shutdown sockets to the kqueue If syslogd is in secure mode, all INET sockets are shutdown. Do not add these to the kqueue because we can't read from them. Also, remove the listen() call when setting up sockets. Syslogd exclusively uses SOCK_DGRAM sockets, so calling listen() is useless. Reviewed by: markj MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41526 --- usr.sbin/syslogd/syslogd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 8d2f3c3edf14..7db5bab11008 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -825,6 +825,8 @@ main(int argc, char *argv[]) exit(1); } STAILQ_FOREACH(sl, &shead, next) { + if (sl->sl_recv == NULL) + continue; EV_SET(&ev, sl->sl_socket, EVFILT_READ, EV_ADD, 0, 0, sl); if (kevent(kq, &ev, 1, NULL, 0, NULL) == -1) { warn("failed to add kevent to kqueue"); @@ -3741,9 +3743,6 @@ socksetup(struct addrinfo *ai, const char *name, mode_t mode) return (NULL); } dprintf("new socket fd is %d\n", s); - if (ai->ai_socktype != SOCK_DGRAM) { - listen(s, 5); - } sl_recv = socklist_recv_sock; #if defined(INET) || defined(INET6) if (SecureMode && (ai->ai_family == AF_INET ||