From patchwork Thu Dec 5 21:41:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 3975 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:1d8b:b0:5dc:2311:f747 with SMTP id hp11csp462643mab; Thu, 5 Dec 2024 13:42:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUyqdGALS+HqfZohor6CSvEelufDhZa8sHEzr7nKkn01dvufgvEfsqQ+1bi/U/1s2m6jPQnaQKqWKk=@openvpn.net X-Google-Smtp-Source: AGHT+IGfOxtxiwCfWk7+jj5RWeCNM5ZoKBbCpHq2U0eIfcLS7v2Vca+jxZ6FVARD11fZSfSXQZnL X-Received: by 2002:a05:6830:4181:b0:71d:445a:80b9 with SMTP id 46e09a7af769-71dcf4e5f70mr392434a34.16.1733434935653; Thu, 05 Dec 2024 13:42:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733434935; cv=none; d=google.com; s=arc-20240605; b=CbYZpwGjjLKV95Q/VC95AO4+7pbVGzhmBNLwkfSFtbCGZFtJbSYd8hdVsJSrR67mPW lP+aF48Hgjl6CGQuQ1p3lbvmJeWNc+e8rboFgHbJQJymlog7yeAvDV8SR97pKwsK3twL borfuyjrn29xZJEPoz3vyPzX7Ls/WOJUF3wIkErz9rxlFM7i9tuWEotxmd8lc/wRmgNd 3exETJzhUo+5RC/5s3019OMrBNCi2BW1okH4YxhQSt4gyuxFTZ4WpqFskVaclPRHArbp HAuRMWWfFzrgg9PW2e/J9ZsgratiqeyezoIm8ARTd7bE0GTWUa6cxMsGMgdlPUbGv19w 5row== 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; bh=36hagcN3II/cOQjF7zWp101S7tQRqC+IJQEFYQQbDRY=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=j7BkrEsm0Q8Yi9nV5EdNhecBp8FcPhA0p6DJpHF6sgzWtcN/SoUBUpd0QU/kP3Uv4n CHjn+FWa+S216SIoeEHC29YuyN5JqIfxuzO51tAqgiBmfyYfU+ejE9m+x6To3+n2iC+h YZPpULc+BG8HVsrjLjwpkl3TPl8QN3teYeougAyPlttLD3WCv5ZS7X5sLpaabR5q1Ly3 XiQI3PUAHxypIW6w5SmEZWN4tD4zwSDbV/PI2Sd/tf6Pda+GTBjhZoOT4JqiM8CpljWt oUB8B9glZxdqNrUt9z70buphEGy/VeYOtUYbZmvClcOfCLtmVBMyD9zsk3qla4to48Mx jIUA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="fYRpjS/y"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=JwgdNtFh; 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 006d021491bc7-5f279305a0csi1009655eaf.59.2024.12.05.13.42.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Dec 2024 13:42:15 -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=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="fYRpjS/y"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=JwgdNtFh; 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 [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 1tJJbr-00025O-IN; Thu, 05 Dec 2024 21:42:07 +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 1tJJbq-00025H-QU for openvpn-devel@lists.sourceforge.net; Thu, 05 Dec 2024 21:42:06 +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=gCtEQYZAJ8RoIlfX5SKc+rlEM36EnlMIe6MvwG9RO9E=; b=fYRpjS/yb31ZXD2ZKwgyhllAtv 9e9yLieqcHTXksBktMT4/T8g29Eftx4NJDS2RypBJ13fo9tyX450X9zL8MLOWOEzxkvEQsmfID8RK y/w/0EaSdpJIldRVFrsrPzXx5rItAlpQjgtuAfD6ZPVGrS0EnsJDeps1z4PSe57Wg4Jw=; 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=gCtEQYZAJ8RoIlfX5SKc+rlEM36EnlMIe6MvwG9RO9E=; b=JwgdNtFhMu9+TsmuRf0UQYLKzt dm+drGicpPnWNOSeMSbuS5R+v9aNzLzbFevxje6RkzHMuAiTVLZoLZAEb7o4DKOos6M5evPuck4cH /kqYf/rRvFOa2r+5AtadlMay+FqbvEGP8dek1uVW2r/oqNCz2TwhTNvleB1MDbXIyq9c=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] 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 1tJJbp-0006qJ-Bj for openvpn-devel@lists.sourceforge.net; Thu, 05 Dec 2024 21:42:06 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 4B5Lfwv0023552 for ; Thu, 5 Dec 2024 22:41:58 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 4B5Lfw7u023551 for openvpn-devel@lists.sourceforge.net; Thu, 5 Dec 2024 22:41:58 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Thu, 5 Dec 2024 22:41:58 +0100 Message-ID: <20241205214158.23542-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", 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 Make it clearer where the blocks are. Change-Id: If645c3faf149bac82167a91be13541b30a1b8d6a Signed-off-by: Frank Lichtenheld Acked-by: Lev Stipakov --- Content analysis details: (0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [193.149.48.174 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [193.149.48.174 listed in bl.score.senderscore.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-Headers-End: 1tJJbp-0006qJ-Bj Subject: [Openvpn-devel] [PATCH v3] Fix some formatting related to if/else and macros 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?1817638270737551605?= X-GMAIL-MSGID: =?utf-8?q?1817638270737551605?= From: Frank Lichtenheld Make it clearer where the blocks are. Change-Id: If645c3faf149bac82167a91be13541b30a1b8d6a Signed-off-by: Frank Lichtenheld Acked-by: Lev Stipakov --- 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/+/821 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Lev Stipakov diff --git a/src/openvpn/helper.c b/src/openvpn/helper.c index bbdbc04..9e28e87 100644 --- a/src/openvpn/helper.c +++ b/src/openvpn/helper.c @@ -500,7 +500,7 @@ push_option(o, print_opt_route_gateway_dhcp(&o->gc), M_USAGE); } } - else + /* * HELPER DIRECTIVE: * @@ -511,7 +511,7 @@ * pull * tls-client */ - if (o->client) + else if (o->client) { o->pull = true; o->tls_client = true; diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index f296788..e79a118 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -1822,7 +1822,9 @@ } else #endif - man->connection.sd_cli = socket_do_accept(man->connection.sd_top, &act, false); + { + man->connection.sd_cli = socket_do_accept(man->connection.sd_top, &act, false); + } if (socket_defined(man->connection.sd_cli)) { @@ -1971,9 +1973,11 @@ } else #endif - msg(D_LINK_ERRORS | M_ERRNO, - "MANAGEMENT: connect to %s failed", - print_sockaddr(man->settings.local->ai_addr, &gc)); + { + msg(D_LINK_ERRORS | M_ERRNO, + "MANAGEMENT: connect to %s failed", + print_sockaddr(man->settings.local->ai_addr, &gc)); + } throw_signal_soft(SIGTERM, "management-connect-failed"); goto done; } diff --git a/src/openvpn/openvpn.c b/src/openvpn/openvpn.c index 1db5422..c52540c 100644 --- a/src/openvpn/openvpn.c +++ b/src/openvpn/openvpn.c @@ -274,10 +274,10 @@ /* Query passwords before becoming a daemon if we don't use the * management interface to get them. */ -#ifdef ENABLE_MANAGEMENT if (!(c.options.management_flags & MF_QUERY_PASSWORDS)) -#endif - init_query_passwords(&c); + { + init_query_passwords(&c); + } /* become a daemon if --daemon */ if (c.first_time) diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 2e584c7..3d33844 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -3861,8 +3861,9 @@ } else #endif - - rgi6->gateway.addr_ipv6 = gw; + { + rgi6->gateway.addr_ipv6 = gw; + } rgi6->flags |= RGI_ADDR_DEFINED; if (ifp) diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index efd742c..01874fe 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -3389,8 +3389,10 @@ } else #endif - buf->len = recvfrom(sock->sd, BPTR(buf), buf_forward_capacity(buf), 0, - &from->dest.addr.sa, &fromlen); + { + buf->len = recvfrom(sock->sd, BPTR(buf), buf_forward_capacity(buf), 0, + &from->dest.addr.sa, &fromlen); + } /* FIXME: won't do anything when sock->info.af == AF_UNSPEC */ if (buf->len >= 0 && expectedlen && fromlen != expectedlen) { diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 1f8eb1e..33c22b4 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -327,7 +327,9 @@ } else #endif /* ifdef ENABLE_MANAGEMENT */ - get_user_pass(&auth_user_pass, auth_file, UP_TYPE_AUTH, flags); + { + get_user_pass(&auth_user_pass, auth_file, UP_TYPE_AUTH, flags); + } } }