From patchwork Mon Jan 26 14:54:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4733 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:8468:b0:80a:3855:ce6a with SMTP id u8csp1382796max; Mon, 26 Jan 2026 06:54:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWsNdGdW7j0ErsqIlCRBZMsDoEj8+YYLROG8jTYjYBG9ADg40gg3NmHSnqwkr7jB7tdbELuZokepvw=@openvpn.net X-Received: by 2002:a05:6870:b3f5:b0:404:3807:fcd3 with SMTP id 586e51a60fabf-408f7b53354mr2309035fac.1.1769439284912; Mon, 26 Jan 2026 06:54:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769439284; cv=none; d=google.com; s=arc-20240605; b=h4KIBBEmRgkLOQLv8GTbwuNZz32jdS1FqV8qMBleKldG0ZupG2tUIz5hP2UZGwjg66 q6Ugtpyn6IkIGve4j0U39NsMREwjnqYxPsPpkjK2J0OXxwIcUAehCaNlyg2ALfqhsuhX YZe/qcpmo57KAytKvW4/DXpUi8/HFjpiq/cgoEPvbB7CDywcBZ9lbFqthWzKgrZa3UHB afB2kYAx61ISrrAwTKECAIQFLm1ZMIqNZ0KCbBs5CJsC7N+9P+5+hoGfj2bxul7DxFWU rQsy7XPHyhDAwjUslscFV+HbsLHHwtawA7y+AR6V6qs5wTDLPN3QnI5SpgNLC7xoH2IZ JvZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=ypBggff2CuRw+rRCnkiO3xTHQDCI6dipZFm+Q4VTBOg=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=LHxn2rK/mpswelMi8+gS0iDDmAZGSdmtNV2tHvATFzO+i5rDjBK+AQV1xH5AhAWbxX v+lHoOix0D0yTQdocK9I5ccVeGboWA+7YSzwvxkpNPMO3+y5PqLLAi8e6AA5ferQAv0l 4ugyAFYOfeAf578cQfrDZiGlhAvMshpSWLuDRJaZ2qiSzWkyFb5vaFrkDjzUlch5bj9X pRxDiiO2QIx7/oHl4XaC/fDyMcTisqY1vk4aiJI92CI9+L9Ap17ukAH2DJbOemPJucDI n1exif9oUbmin5LNJZWr2krQrgXehhll90fGEWZVZO8kZnTvvpVNqpf7FgIvMVkEJB6c czZg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b="Yp8Pnd/X"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Qh5mg3mN; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=aU4snp7E; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-408af823cbasi7961826fac.82.2026.01.26.06.54.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Jan 2026 06:54:44 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b="Yp8Pnd/X"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Qh5mg3mN; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=aU4snp7E; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ypBggff2CuRw+rRCnkiO3xTHQDCI6dipZFm+Q4VTBOg=; b=Yp8Pnd/X3bCegDMPQIu0vUIRVz ViOKabTIWhVn0OZDt4gRs04KcQU5TiAAJBGxwAhZ054ryuyMwIv6D4PopxAbVUBZzMJ1z4agkBDsE nlpIAiYK3wfX7NPV8EppkC6oWbvQZf7owtePzeIF8jLno/VtAb2jG7RIvAZhl7rhnKug=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vkNzF-0005US-EA; Mon, 26 Jan 2026 14:54:42 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vkNzE-0005UG-Di for openvpn-devel@lists.sourceforge.net; Mon, 26 Jan 2026 14:54:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vgeh/O8HjtTv7yHR7HDDRYpVUcNdgh/qTHr2724EA9g=; b=Qh5mg3mNUj0ZWC/tXkxZ1r1Xbz WbpBq/V/em6jX/t8n+bSbqMPb/+eXDdAMXKaQ66IBIrH3CO2yRCAiVvvK+atA05UDQK9tcikMGqLu NlLTc/RCyqWE3jznf1/wPReI85GYzB/wDnl6Qs525mIyIK+GF+07SVGiKCLWD9h6oDxs=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vgeh/O8HjtTv7yHR7HDDRYpVUcNdgh/qTHr2724EA9g=; b=aU4snp7EUSAv7RSnzyo4XT6ItE 6i2od3jqOSR1TA1j7CwFKSl95KJKWEtGIj1PJcwCy6VeC3fXx3oopKfEIK83WF3XwAtOpWXbZAeVd V2JeoOsYP6V3FayqQrZo4W4aVburz5JQzhzosRz4mFufShEyEOZ1yxHRyrkPtulqYqWs=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vkNzD-0001co-OM for openvpn-devel@lists.sourceforge.net; Mon, 26 Jan 2026 14:54:41 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 60QEsWHM031270 for ; Mon, 26 Jan 2026 15:54:32 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 60QEsWFw031267 for openvpn-devel@lists.sourceforge.net; Mon, 26 Jan 2026 15:54:32 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 26 Jan 2026 15:54:26 +0100 Message-ID: <20260126145432.31249-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.51.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Frank Lichtenheld Seems all our platforms define it. Reported-by: Marc Heuse Github: Fixes OpenVPN/openvpn#965 Change-Id: I87679949bdef6319d7490d561f0136633244c2b9 Signed-off-by: Frank Lichtenheld Acked-by: Gert [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URI: openvpn.net] 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1vkNzD-0001co-OM Subject: [Openvpn-devel] [PATCH v2] socket: Remove ifdef for SO_{RCV, SND}BUF X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1855391567741114382?= X-GMAIL-MSGID: =?utf-8?q?1855391567741114382?= From: Frank Lichtenheld Seems all our platforms define it. Reported-by: Marc Heuse Github: Fixes OpenVPN/openvpn#965 Change-Id: I87679949bdef6319d7490d561f0136633244c2b9 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1486 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1486 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 331249d..58ccda9 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -419,57 +419,45 @@ static int socket_get_sndbuf(socket_descriptor_t sd) { -#if defined(SOL_SOCKET) && defined(SO_SNDBUF) int val; - socklen_t len; + socklen_t len = sizeof(val); - len = sizeof(val); if (getsockopt(sd, SOL_SOCKET, SO_SNDBUF, (void *)&val, &len) == 0 && len == sizeof(val)) { return val; } -#endif return 0; } static void socket_set_sndbuf(socket_descriptor_t sd, int size) { -#if defined(SOL_SOCKET) && defined(SO_SNDBUF) if (setsockopt(sd, SOL_SOCKET, SO_SNDBUF, (void *)&size, sizeof(size)) != 0) { msg(M_WARN, "NOTE: setsockopt SO_SNDBUF=%d failed", size); } -#endif } static int socket_get_rcvbuf(socket_descriptor_t sd) { -#if defined(SOL_SOCKET) && defined(SO_RCVBUF) int val; - socklen_t len; + socklen_t len = sizeof(val); - len = sizeof(val); if (getsockopt(sd, SOL_SOCKET, SO_RCVBUF, (void *)&val, &len) == 0 && len == sizeof(val)) { return val; } -#endif return 0; } -static bool +static void socket_set_rcvbuf(socket_descriptor_t sd, int size) { -#if defined(SOL_SOCKET) && defined(SO_RCVBUF) if (setsockopt(sd, SOL_SOCKET, SO_RCVBUF, (void *)&size, sizeof(size)) != 0) { msg(M_WARN, "NOTE: setsockopt SO_RCVBUF=%d failed", size); - return false; } - return true; -#endif } void