From patchwork Tue Jun 3 16:30:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4277 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:9994:b0:667:60b:5921 with SMTP id d20csp3324703mav; Tue, 3 Jun 2025 09:30:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX08gVsHKBRuF/bSdoLSH0M6m08LV36bnZ+SybEIPQQh+eejCpwaO6BFEVuyMAgXnHIbds6C4wBgS0=@openvpn.net X-Google-Smtp-Source: AGHT+IFrBAfSWySPa3bLRtSePlebRIjzNQmb9zMOcflzC5NQBY3wFg3vGMSEhgAxMj6zYLne7GcE X-Received: by 2002:a05:6870:d8c9:b0:2d4:d9d6:c8dc with SMTP id 586e51a60fabf-2e99e020fbcmr2041781fac.9.1748968254404; Tue, 03 Jun 2025 09:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1748968254; cv=none; d=google.com; s=arc-20240605; b=b6L9gGjuprdSNslCSDI2sZRR94o3I3iOKZabNX9NuxrEocn3P3xsXX/hLeNJzPqpsL fK+sKq8Lb+r5eg6acTo/6zU1o5soTBwiRbKJ59KCBsBsTVatNV8wFkMcNo/iPKmUPI7+ vFrJgQhEAOLXqEW9Tu602vha2LliQdktPxcuVDO3jCa6FAd1g48GfPuVRJIW1bLUxbzq ervbp0IMzL2lAUG8p+/XxSlbmeTahqY6OOkK8B1AjSJpUjHmwb81Qj07NUktHBrMWSxP WFhKIRzHvvkhO/M6vSDk9tiXwy18AdHK3Zzn3esWoLDNuUrDu/kRnBoHHmNZD7b3p0Qk PGHw== 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=t4nJXrnGsnTjqNb0HAH0YqnAGjWnuO0ZWtaWq6884nU=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=YbUUxpfqzHHexroR0+qTRC8ZPUehZxqkkc2KZmHkvCEyLRzG2SEP8cyFFlOdaLkNY2 9Ogi+47kopmF2r/6itaIB/oOBEJuUm90YJ4ra9Qj6+L0TrMimvts5N1yP3Z8al5AZEBl 3c54WWN+JjGUrWyYxEOqOzFGrwV8+WuOTkNAVG5phOMhUIZHomzxVHobZ/U31a5ZTW2f p+QBU/EWf7RAqq+VB9wjw73GofaUlwbOPv8vfYQz78XzPg4RzYy7sC8LJP4nDCmln8Tk LkXOXFq3BlEOYgRoBnwGXssfyXUMvTCr8uSkPcF37BYF2C9iQmnwYJflYP0lxGaB7lJk jT/A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=MZvM7mHQ; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=B1RDWfRh; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=EYdbPsmQ; 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-2e9067ade5esi6999960fac.101.2025.06.03.09.30.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jun 2025 09:30:54 -0700 (PDT) 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=MZvM7mHQ; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=B1RDWfRh; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=EYdbPsmQ; 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=t4nJXrnGsnTjqNb0HAH0YqnAGjWnuO0ZWtaWq6884nU=; b=MZvM7mHQF9xpX9DCjiV5lYSmWp YOEwMRgKyloWQv7L0Xqun3nHARZq1zGTCSGYrNdrWyoHrSnQSQ7qtHsUv3x5WhUE/8HSXWLZarSGo gfbp4kNQGOtu/NK4oR9ztWkUH3dyaoD5clKyD2avgqRoy5qcx0SOjV1eHDcmkO8ytcA8=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1uMUXL-0000lA-Oq; Tue, 03 Jun 2025 16:30:51 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1uMUXJ-0000l1-Q1 for openvpn-devel@lists.sourceforge.net; Tue, 03 Jun 2025 16:30:49 +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=gE82gA/CxA7sF45yHsgOrgExO/QgGKqp09jdpIHDH2s=; b=B1RDWfRhp6nVPPzxqBj8DV6anz V7eKhtYmvNUFHT4u/qygqtRGqDlIS6vPfXPFaWTdoXIckdQ34kuIIvBygJs805SE8kL2EZ9AjMUyZ jp0urwb8TstkCdk0li4vD+UC/Ta97DedRLj1ULnmIuK4Zf2tE6FihzjuQY8bRs8UhddY=; 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=gE82gA/CxA7sF45yHsgOrgExO/QgGKqp09jdpIHDH2s=; b=EYdbPsmQCH3f9gY2oyMqD5+Xh6 g78wRhjLj0jw7FeTEHZlApLwWa4kVbi3ZWnOAsBpvYQRmnsKXZW5j6wnqwhM0GPF+OHuvt2U7ccG7 0IYaB4WeJasyb85p62JiGKOzapuwegbHbd/zv/Mkp4DPuPsUgO2UB+Q1NSqu4EaCQM2Q=; Received: from [193.149.48.143] (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 1uMUXH-0003sG-MD for openvpn-devel@lists.sourceforge.net; Tue, 03 Jun 2025 16:30:49 +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 553GUeFC031195 for ; Tue, 3 Jun 2025 18:30:40 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 553GUeU6031194 for openvpn-devel@lists.sourceforge.net; Tue, 3 Jun 2025 18:30:40 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 3 Jun 2025 18:30:34 +0200 Message-ID: <20250603163040.31169-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-Headers-End: 1uMUXH-0003sG-MD Subject: [Openvpn-devel] [PATCH v1] Fix various badly placed comments in preparation for reformat 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?1833926136024329192?= X-GMAIL-MSGID: =?utf-8?q?1833926136024329192?= From: Frank Lichtenheld Change-Id: I83831060fdf5588a0ada8d6abbedc7ce3ded4182 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering --- 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/+/1030 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c index b2a5bf5..4b83eeb 100644 --- a/src/openvpn/buffer.c +++ b/src/openvpn/buffer.c @@ -910,7 +910,8 @@ { return true; } - if ((flags & CC_PRINT) && (c >= 32 && c != 127)) /* allow ascii non-control and UTF-8, consider DEL to be a control */ + /* allow ascii non-control and UTF-8, consider DEL to be a control */ + if ((flags & CC_PRINT) && (c >= 32 && c != 127)) { return true; } diff --git a/src/openvpn/multi_io.c b/src/openvpn/multi_io.c index 7f47319..6ab06bb 100644 --- a/src/openvpn/multi_io.c +++ b/src/openvpn/multi_io.c @@ -247,7 +247,8 @@ case TA_TUN_WRITE: looking_for = TUN_WRITE; tun_input_pending = NULL; - c->c2.timeval.tv_sec = 1; /* For some reason, the Linux 2.2 TUN/TAP driver hits this timeout */ + /* For some reason, the Linux 2.2 TUN/TAP driver hits this timeout */ + c->c2.timeval.tv_sec = 1; perf_push(PERF_PROC_OUT_TUN_MTCP); io_wait(c, IOW_TO_TUN); perf_pop(); diff --git a/src/openvpn/networking.h b/src/openvpn/networking.h index f06d6df..d9aca1e 100644 --- a/src/openvpn/networking.h +++ b/src/openvpn/networking.h @@ -302,7 +302,7 @@ int metric); /** - * Delete a route for an IPv4 address/network + * Delete a route for an IPv6 address/network * * @param ctx the implementation specific context * @param dst the destination of the route diff --git a/src/openvpn/options.c b/src/openvpn/options.c index bcc18a5..4528edd 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -8398,9 +8398,10 @@ VERIFY_PERMISSION(OPT_P_DHCPDNS); setenv_foreign_option(options, (const char **)p, 3, es); } - else if (streq(p[0], "route-method") && p[1] && !p[2]) /* ignore when pushed to non-Windows OS */ + else if (streq(p[0], "route-method") && p[1] && !p[2]) { VERIFY_PERMISSION(OPT_P_ROUTE_EXTRAS); + /* ignore when pushed to non-Windows OS */ } #endif /* ifdef _WIN32 */ #if PASSTOS_CAPABILITY diff --git a/src/openvpn/otime.c b/src/openvpn/otime.c index d77c99e..7a362e0 100644 --- a/src/openvpn/otime.c +++ b/src/openvpn/otime.c @@ -44,8 +44,10 @@ void update_now(const time_t system_time) { - const int forward_threshold = 86400; /* threshold at which to dampen forward jumps */ - const int backward_trigger = 10; /* backward jump must be >= this many seconds before we adjust */ + /* threshold at which to dampen forward jumps */ + const int forward_threshold = 86400; + /* backward jump must be >= this many seconds before we adjust */ + const int backward_trigger = 10; time_t real_time = system_time + now_adj; if (real_time > now) diff --git a/src/openvpn/otime.h b/src/openvpn/otime.h index 9543732..04aa5c6 100644 --- a/src/openvpn/otime.h +++ b/src/openvpn/otime.h @@ -246,7 +246,8 @@ static inline bool tv_within_sigma(const struct timeval *t1, const struct timeval *t2, unsigned int sigma) { - const int delta = tv_subtract(t1, t2, TV_WITHIN_SIGMA_MAX_SEC); /* sigma should be less than 10 minutes */ + /* sigma should be less than 10 minutes */ + const int delta = tv_subtract(t1, t2, TV_WITHIN_SIGMA_MAX_SEC); return -(int)sigma <= delta && delta <= (int)sigma; } diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h index de1876a..379a31a 100644 --- a/src/openvpn/tun.h +++ b/src/openvpn/tun.h @@ -212,7 +212,8 @@ #ifdef _WIN32 HANDLE hand; - OVERLAPPED dco_new_peer_ov; /* used for async NEW_PEER dco call, which might wait for TCP connect */ + /* used for async NEW_PEER dco call, which might wait for TCP connect */ + OVERLAPPED dco_new_peer_ov; struct overlapped_io reads; struct overlapped_io writes; struct rw_handle rw_handle;