From nobody Wed Nov 29 16:18:21 2023 X-Original-To: dev-commits-ports-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 4SgPdB29Vyz52vLg; Wed, 29 Nov 2023 16:18:22 +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 4SgPdB1ZL8z3CK7; Wed, 29 Nov 2023 16:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701274702; 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=8s3Cy0NExrNw/QInP0cdBfqSiyQ+1rZvs+Ia0ceY1zg=; b=OZqu7mwbuDHlfoJArBT0i//XaOTR92fEWhuaWL4Kqd2wNtJmdWbg0RxkX8y7LKhdjdBGlT Rmm0udWShuMkMRt9mpBHTSBbFE8x0zM7SLrtY7rNlB4G63cywRsssG7YSzl9Brkw1bsOOl cIbsSiTd+xReezHnBet5CM1JSOdO8S7Dlvf4hH+3u5O4dnBdWvwaFbVXK5IRLhebSmDlVX nvD28jHQwxLcRR9pElw3+XuRPhwvE4pL5gfuVMBw4btQ8/zKRU6fYhTW7WbLv8P3XNS4h8 6DMcrkBbiG4742/JAebLk0lmF5/OWtZvuMkVAsU4i40GmWFkyU9YFQfyWv/K8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701274702; 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=8s3Cy0NExrNw/QInP0cdBfqSiyQ+1rZvs+Ia0ceY1zg=; b=ZHlxvQIX1x75Il4FaN8VODMO3l276JChlPbEa2ni8hfxo8HzuO6E0UJH0iart+eAumSZcE r0+EGzrgalImSi3kJeGF8sZlxWPuDq4GHq4uNAz4bWeLTio+14AvGKd/CFZcxC8HgzTsup LWWe2CzvquSfZipRb515KZMHUKA4ideVlrr6E2FW6CaGS5RI3NkT3URUnRX/nsjkAu+hjW b/YDGPQzuqcFPGYmgBfl5z4t9MxT+Kq/1k6BeHt42Sn8Ckyo6TOS6nKWO9m3GQuVUPh8Zi B8bbBO2JjarO+DNAIW3Ac/rOgIC2dAI40A5fe5nZ+EnVkz2VJ25XwrCFi6pluw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701274702; a=rsa-sha256; cv=none; b=FFZ/JagHnLO7YcI6MpEh30mqUmk3/daWZO080ZyP8B1XhStWCs6NFKmVGw8fGgzlCZYlYq p+1G2CQ9SndkBUhTzzmL48hIoI6MHZ9p3vTdO2VUDcLr2STH9GePJdqRrCpp3HZNMEj5Io wu2k+ELDT9+AVGPKSm0nXYqzQhaVkDHFnlLAHOOBnRLzp2ArHwnGPbbwg0sBIu3JdZcaCU gpPgrFyTkSIwKowTVbEmZUc3Vgv80sEgWYbj0azlClBZSErRAMkrVSUjiv4vRMmxuL7pa4 EJgDwEtSyKHVDohHf5zs9As6Ql7sVa7R+YLnOcAArVkMo5cuiVy4MDBcGaE0cQ== 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 4SgPdB0Wjrz1CDb; Wed, 29 Nov 2023 16:18:22 +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 3ATGILs9010941; Wed, 29 Nov 2023 16:18:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ATGILmf010938; Wed, 29 Nov 2023 16:18:21 GMT (envelope-from git) Date: Wed, 29 Nov 2023 16:18:21 GMT Message-Id: <202311291618.3ATGILmf010938@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Cy Schubert Subject: git: 60c99d3a9308 - main - security/wpa_supplicant*: ctrl_iface set sendbuf size List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 60c99d3a93081cc603e104c0e6c9fe389e774657 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=60c99d3a93081cc603e104c0e6c9fe389e774657 commit 60c99d3a93081cc603e104c0e6c9fe389e774657 Author: Cy Schubert AuthorDate: 2023-11-29 16:16:49 +0000 Commit: Cy Schubert CommitDate: 2023-11-29 16:18:11 +0000 security/wpa_supplicant*: ctrl_iface set sendbuf size In order to avoid running into the default net.local.dgram.maxdgram of 2K currently when calling sendto(2) try to set the sndbuf size to the maximum ctrl message size. The problem occured, e.g., when the scan_list result had enough BSSIDs so the text output would exceed 2048 bytes. Written by: bz PR: 274990 Obtained from: https://reviews.freebsd.org/D42558 --- security/wpa_supplicant-devel/Makefile | 1 + .../patch-wpa__supplicant_ctrl__iface__unix.c | 36 ++++++++++++++++++++++ security/wpa_supplicant/Makefile | 2 +- .../patch-wpa__supplicant_ctrl__iface__unix.c | 36 ++++++++++++++++++++++ 4 files changed, 74 insertions(+), 1 deletion(-) diff --git a/security/wpa_supplicant-devel/Makefile b/security/wpa_supplicant-devel/Makefile index 8ae521bddb93..93751e2c2054 100644 --- a/security/wpa_supplicant-devel/Makefile +++ b/security/wpa_supplicant-devel/Makefile @@ -1,5 +1,6 @@ PORTNAME= wpa_supplicant PORTVERSION= ${COMMIT_DATE} +PORTREVISION= 1 CATEGORIES= security net PKGNAMESUFFIX= -devel diff --git a/security/wpa_supplicant-devel/files/patch-wpa__supplicant_ctrl__iface__unix.c b/security/wpa_supplicant-devel/files/patch-wpa__supplicant_ctrl__iface__unix.c new file mode 100644 index 000000000000..cc73ac35cd35 --- /dev/null +++ b/security/wpa_supplicant-devel/files/patch-wpa__supplicant_ctrl__iface__unix.c @@ -0,0 +1,36 @@ +--- wpa_supplicant/ctrl_iface_unix.c.orig 2022-01-16 12:51:29.000000000 -0800 ++++ wpa_supplicant/ctrl_iface_unix.c 2023-11-29 08:12:07.843443000 -0800 +@@ -506,6 +506,10 @@ + struct group *grp; + char *endp; + int flags; ++#if defined(__FreeBSD__) ++ int optval, rc; ++ socklen_t optlen; ++#endif + + buf = os_strdup(wpa_s->conf->ctrl_interface); + if (buf == NULL) +@@ -678,6 +682,22 @@ + /* Not fatal, continue on.*/ + } + } ++ ++#if defined(__FreeBSD__) ++ /* Ensure we can send a full length message atomically. */ ++ optval = 0; ++ optlen = sizeof(optval); ++ if (getsockopt(priv->sock, SOL_SOCKET, SO_SNDBUF, &optval, &optlen) == -1) { ++ wpa_printf(MSG_INFO, "failed to get sndbuf for sock=%d: %s", ++ priv->sock, strerror(errno)); ++ } else if (optval < CTRL_IFACE_MAX_LEN) { ++ optval = CTRL_IFACE_MAX_LEN; ++ if (setsockopt(priv->sock, SOL_SOCKET, SO_SNDBUF, &optval, ++ sizeof(optval)) == -1) ++ wpa_printf(MSG_ERROR, "failed to set sndbuf for " ++ "sock=%d: %s", priv->sock, strerror(errno)); ++ } ++#endif + + eloop_register_read_sock(priv->sock, wpa_supplicant_ctrl_iface_receive, + wpa_s, priv); diff --git a/security/wpa_supplicant/Makefile b/security/wpa_supplicant/Makefile index 917544b9cf72..fbb215fe0e82 100644 --- a/security/wpa_supplicant/Makefile +++ b/security/wpa_supplicant/Makefile @@ -1,6 +1,6 @@ PORTNAME= wpa_supplicant PORTVERSION= 2.10 -PORTREVISION= 9 +PORTREVISION= 10 CATEGORIES= security net MASTER_SITES= https://w1.fi/releases/ diff --git a/security/wpa_supplicant/files/patch-wpa__supplicant_ctrl__iface__unix.c b/security/wpa_supplicant/files/patch-wpa__supplicant_ctrl__iface__unix.c new file mode 100644 index 000000000000..cc73ac35cd35 --- /dev/null +++ b/security/wpa_supplicant/files/patch-wpa__supplicant_ctrl__iface__unix.c @@ -0,0 +1,36 @@ +--- wpa_supplicant/ctrl_iface_unix.c.orig 2022-01-16 12:51:29.000000000 -0800 ++++ wpa_supplicant/ctrl_iface_unix.c 2023-11-29 08:12:07.843443000 -0800 +@@ -506,6 +506,10 @@ + struct group *grp; + char *endp; + int flags; ++#if defined(__FreeBSD__) ++ int optval, rc; ++ socklen_t optlen; ++#endif + + buf = os_strdup(wpa_s->conf->ctrl_interface); + if (buf == NULL) +@@ -678,6 +682,22 @@ + /* Not fatal, continue on.*/ + } + } ++ ++#if defined(__FreeBSD__) ++ /* Ensure we can send a full length message atomically. */ ++ optval = 0; ++ optlen = sizeof(optval); ++ if (getsockopt(priv->sock, SOL_SOCKET, SO_SNDBUF, &optval, &optlen) == -1) { ++ wpa_printf(MSG_INFO, "failed to get sndbuf for sock=%d: %s", ++ priv->sock, strerror(errno)); ++ } else if (optval < CTRL_IFACE_MAX_LEN) { ++ optval = CTRL_IFACE_MAX_LEN; ++ if (setsockopt(priv->sock, SOL_SOCKET, SO_SNDBUF, &optval, ++ sizeof(optval)) == -1) ++ wpa_printf(MSG_ERROR, "failed to set sndbuf for " ++ "sock=%d: %s", priv->sock, strerror(errno)); ++ } ++#endif + + eloop_register_read_sock(priv->sock, wpa_supplicant_ctrl_iface_receive, + wpa_s, priv);