From patchwork Thu Nov 28 12:04:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "d12fk (Code Review)" X-Patchwork-Id: 3967 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:57cb:b0:5db:cfa9:4424 with SMTP id v11csp1176164mau; Thu, 28 Nov 2024 04:05:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWp7rHqCQby1NGFTEemQFsTx46NFBA1Cq+NSpcckg2XdvhUngPDap15VjthVR6j1+egCnQp9waoi8A=@openvpn.net X-Google-Smtp-Source: AGHT+IFqYuq1aDLontZGA66qqWen9o3vJUDR9TEwLfi3ZyBtSSLSUu1LBMZAByNUGT/N5V/W2eAz X-Received: by 2002:a05:6602:6d0b:b0:83a:639b:bc44 with SMTP id ca18e2360f4ac-843ece79047mr930977739f.3.1732795516417; Thu, 28 Nov 2024 04:05:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732795516; cv=none; d=google.com; s=arc-20240605; b=H5yM9dRPpxt7Y8XItA5P4VrRcKTyJamGfsU93aqeN5IN0LlFO0F9vmqS61twZpgnw6 LAesBxoYcC5SEYY6KCtO2fTqZgho2pHPIvKSgFGfRxu/mHg55q3DuG83i90Yt8haKU7z GRj3zZ9XCBndfnmyHgmUfkwszReGq3eLUHHdw19yV/cD/ezpfSBv+V45GDbPxFXuJGpO hqDflKcrAl1fPi5nOrdqSh1SExalofJFIV1vEniluIMHSCki6FRce7sTSB9lwQ7VWTVh p2hwO1OWtRXk9L6cXgh0gZfFF32IiWJusOswRCyexBeqbkri9F521r9rbXi0/2eUpcQy +Rag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=7e5Ay20JbjdntJH8zVQjePNFho5rQ1V5PbOG7ELwWkM=; fh=GFP4qDxgyJ2WEPo/oeLZg3Mj4NqvY1j2nTvTt7psNwg=; b=MOBXE4m2qnwhTGAB/MIkxq7tUbJ3tGdFSLkOLDx+atdHyvxmfgTM8EPUlSO3zf3MUG 0BpWSrrkKF5eilcNM/Y5WOInrAdr83cOfmj5CHhqFZ31nCyj9ylVTAqNY+1fzNloZcIj IZl2ENtgbWbv0FzL1OGgkzYCZX/if0/q+tChAGlmQEAf+dDzZ3HVl5ptBRhTir8svJr2 S6F5vPMsqsty5Et1pe1AUFsuteLaA2fmWNNUcDo4+O900l7yqNUyxeoF89CtKb3Mz6Kv qicehLN4XPhhoVautidode3h3h1DroFSKemk7V/Mjlgt67+Sag88Xdw/kw2MazU0+KJs lyFQ==; 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=TxF6Z99C; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=P2V2jz0Q; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=DrCseTIQ; 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=openvpn.net; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4e230eb0037si810931173.170.2024.11.28.04.05.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Nov 2024 04:05:16 -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=TxF6Z99C; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=P2V2jz0Q; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=DrCseTIQ; 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=openvpn.net; dara=fail header.i=@openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tGdGd-0006lC-5R; Thu, 28 Nov 2024 12:05:07 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tGdGb-0006l4-Tr for openvpn-devel@lists.sourceforge.net; Thu, 28 Nov 2024 12:05:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=a9dNjbVG5psvxobn88GrRPB45KDFAiUbAMOyb2ekAnA=; b=TxF6Z99CpBM9EPAu3roZ33C/jC fPMFWY8GJMA2te1YA0lJrrAJqJEJA3iRRuVGyI6xQ4MdWocbqFtAvykkzMv0h/2/fdTRxgXdAfjHu yp+6T9x1FaWd5bBdjOB1E1CSjexYTmNiuD5/2Z8t7DmpYb1GlJov+4yz1rFTulglIPOI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=a9dNjbVG5psvxobn88GrRPB45KDFAiUbAMOyb2ekAnA=; b=P 2V2jz0Q4remgQ0tWjE+KG5W/s4mIjM0gtpQeMrRqHAPazURKfK0xxdoiAm3xgOoZj0eQde9V5bUuC 6hBnnYDBAXyURJfGhpEmhs1S+geq9EEoaQwCXAf0m9lsbxvam3tSLmYQQKnBbj7B8z1EzuF4xGJi2 7gydkYUw97LQRZLE=; Received: from mail-wm1-f50.google.com ([209.85.128.50]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1tGdGb-00078d-M1 for openvpn-devel@lists.sourceforge.net; Thu, 28 Nov 2024 12:05:06 +0000 Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-434aabd688fso4445055e9.3 for ; Thu, 28 Nov 2024 04:05:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1732795494; x=1733400294; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=a9dNjbVG5psvxobn88GrRPB45KDFAiUbAMOyb2ekAnA=; b=DrCseTIQZ7JfxUrcx1+FtF2tXtWlAKAheodFFtzC24N7thk0bmp5nMNsla+h4yd/0j T9bf87uiWPYFpJNHo3WY3WTIHFTCcQl7S4ynaGA1lotPSJXVM1jaqsZDB3Kvf26FGG5a YsQzZ4mbAhvpR6BGLhtyvPTtc8MVvg1M/wK5GWyKcEkyfPyxxsDGEQY3Sy0Ps1YPMWEN zixfErlePlLXcrthjXGlBc73Qjq73e20phmDpgcJ81/Plfoq+5/+eRlEUOOxDs0nDTO8 IjKtfJzB4V2vHzV6VYpAPlDX62S8Xe+JFoHMhvFvA2BmD5NoZaUsQ62QbTIrr0b0mXHF JYrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732795494; x=1733400294; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=a9dNjbVG5psvxobn88GrRPB45KDFAiUbAMOyb2ekAnA=; b=gcn+2NdXUFZCQPJR9ARk5v+BJ80FWIhsY68I5WMLP84VD46V34gyVAZv8N6X/5YNX5 bgackT/Ja0EGc6NXqldMbzS3h16BSBcRh+ygKyGdUJTojfvLPYqXM9gYodc+hPKmjrtf O0UWPyL3rtlfBtVhSQ1JzSmcrs1mS3YzsRY3cpwGZGTR50gppHpFs0RidUVRlZ8C82sB kesmGah94Tq0wAQK7TGY+hZ5s0an43+/s6e2EUq0MpuL4juySpRFDTcLsmptaE3qtT+L Z0TEF9+ZOxNsSJdd7FZMj/YvvSdBjKO87CI5VrfVH6Og+byfUVzVcyUEEd5qlgwN4MI4 +T1g== X-Gm-Message-State: AOJu0YyU9Y5h2t3YENDzYnk97+KD3+A82OE3ZvT+C9RPfDb5lXI3RDwB D6tKwCtYk7ZcryFXdksF63x4AhCZMLuubgI/RWTHDVwNW1qI0k0OOPXOaeGPwNHqWEWRKm9Dq96 5 X-Gm-Gg: ASbGnct/GMnR9QiwzIexOGTZ+vCR1Es9mc5/fJmlehXqWblUiAZAK1Yze0PlDPy7Slh 9ZCBHoJw3f1Cwn4kRpIO0O8Pry7jObPBP84RDUF9u+kyE3CrW0YLFQD5gvsiRTGzv7RGa6mHDKD huk0kNo2qWPbSYgd8zh+5JvR/uikFrPnp8HjWw4PEmAK2ONiRgESkQ/R9AUM0JU6CoB4vu8LXII 1fZex+tDOTLO0UdVvrq3kkfUAxM/7vnwSQTtCNh2GRSWwtgb1zTC0RCk5X8ahhLkalsDN/t0AZQ fkcOT4l5VvYNQNrWUi8A8DcEPdNuMhwRteWLlp6eDw== X-Received: by 2002:a05:600c:154d:b0:42c:b16e:7a22 with SMTP id 5b1f17b1804b1-434a9dc3dcfmr66865305e9.12.1732795494031; Thu, 28 Nov 2024 04:04:54 -0800 (PST) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434aa763c50sm51642675e9.12.2024.11.28.04.04.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 04:04:53 -0800 (PST) From: "flichtenheld (Code Review)" X-Google-Original-From: "flichtenheld (Code Review)" X-Gerrit-PatchSet: 1 Date: Thu, 28 Nov 2024 12:04:52 +0000 To: plaisthos Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: If645c3faf149bac82167a91be13541b30a1b8d6a X-Gerrit-Change-Number: 821 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 18ae5df2453f028bbef73172f3a27fa1b8a29d05 References: Message-ID: <1ac4bc9594683e61799818a8b3779e43f679368d-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -1.1 (-) 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: Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit Content analysis details: (-1.1 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.50 listed in list.dnswl.org] 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. [209.85.128.50 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. [209.85.128.50 listed in bl.score.senderscore.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.9 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.50 listed in wl.mailspike.net] 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1tGdGb-00078d-M1 Subject: [Openvpn-devel] [S] Change in openvpn[master]: 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: , Reply-To: frank@lichtenheld.com, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1816967791159518491?= X-GMAIL-MSGID: =?utf-8?q?1816967791159518491?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/821?usp=email to review the following change. Change subject: Fix some formatting related to if/else and macros ...................................................................... Fix some formatting related to if/else and macros Make it clearer where the blocks are. Change-Id: If645c3faf149bac82167a91be13541b30a1b8d6a Signed-off-by: Frank Lichtenheld --- M src/openvpn/helper.c M src/openvpn/manage.c M src/openvpn/openvpn.c 3 files changed, 13 insertions(+), 9 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/821/1 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)