From patchwork Tue Nov 4 10:44:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 4568 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:9ac3:b0:72f:f16c:e055 with SMTP id m3csp271189maw; Tue, 4 Nov 2025 02:45:13 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXcde8ZhUjeBFJOoOG1Cgk7AOu4hKizDMMtD/BVUMHsJEQa9f5U6ehDN24w/JMOYApJXtl8OJGjViM=@openvpn.net X-Google-Smtp-Source: AGHT+IErvI/B9qOA/dPeGSBiaSHTQhjJDtjIkI/OUfVxbRD5bq2ag9CwsTRrYyUkpw7Oun2A4eA5 X-Received: by 2002:a05:6e02:2482:b0:430:a8c5:fdad with SMTP id e9e14a558f8ab-4330d125c17mr248420095ab.6.1762253113251; Tue, 04 Nov 2025 02:45:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1762253113; cv=none; d=google.com; s=arc-20240605; b=hZYLU12qfb2FazSctoJ3EpnAWGmUBLzmfbz2PLkrU3LWgaSfzqb4JzFuHG8zHuCyML M2C9wDF8MGVvlATh3ZWC9JTWgmmGtrHmLoPbjOI8k14fcysS1SEA0VOBCrmKQlsnVSzD lgh+nc/sw7WZSZluLnqoNsJNrPS1rbdFwVh+IBW1Zzx0g02CAwzSzLMr1mYU5N/qh00d FpSbQCJyO7TA8FfYL3faqArsSdEsLZl+7a3HcTe7eN0Nr2ylZCHXexs2TMyc58DhZQ8M A4eO3SZ3y4WUOBHvFiJWOlvN3KL1tpz+Re02b55Ez4937EC4wnCZSo805FzZzbHzzib0 RVNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:cc: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:dkim-signature; bh=9KDuHuIkjOszV0V8YG3Lm9db65SZcW9oAYWh89HcrLE=; fh=10tBNjXj/wkJoIBSfHvI5xr4knRr+m5zCVrzABMRuHI=; b=lathB/OOnwWCuDFyJsqArTvLqUUK8gRk4D99RZPDrHVgw0YvlJDtbixg/blPLyXZDj k7ODW6xIfg0UvN2+CxdsneOOOjhonDEVwfIKmcT3QD9bsQel+WqbWtd7cKe/OZE2aEZr vD0DZz5YVG7HMwrHxqr21OhUtspRA4c2EbwaSFQJi9cXoMm+Jb/qYWK4TnPlPxPHxLAI hCcHI5mdwAGZDyBx6K/JVr5gT2SQGQ4JYQEhXh0FzFifehwn1mkTBIZFXF0syaP8eG+e Uxkxb7tsckKJqS1NHsPl9P541NcMJD6fNbpdBFVne6tcCLN+XtvJFOfUDPGBXL+XvYp+ QnUg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=W7NYDNzY; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=W9e5xyt4; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kRP0Zfiu; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=wVZ6JHvO; 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 Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id e9e14a558f8ab-4332ec26bebsi57935585ab.35.2025.11.04.02.45.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Nov 2025 02:45:13 -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=W7NYDNzY; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=W9e5xyt4; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kRP0Zfiu; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=wVZ6JHvO; 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 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:Cc: 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:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9KDuHuIkjOszV0V8YG3Lm9db65SZcW9oAYWh89HcrLE=; b=W7NYDNzYnVen4C9TI0aOWxeNU/ hPeBiUmQ9PDEjmNOAPf5aHXStKy/in2v91p4vq/wL7Sb8K8auB+9XA/Xrocjk1Ce/bZvJvHRUWURU FUVRl66O0fJTIyRC/FMv1cS/PorFOY3l/hE4LU0bvI5ZXM+GTmfPiyz5takm7S597d0s=; 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 1vGEXF-0008Fq-31; Tue, 04 Nov 2025 10:45:09 +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 1vGEXC-0008Fg-6K for openvpn-devel@lists.sourceforge.net; Tue, 04 Nov 2025 10:45:07 +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:Cc:To:From:Sender:Reply-To: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=RKaFlOy8tHZCW3OqqfxXShSKzA/9NNHXYcqOxN0wmmo=; b=W9e5xyt4weU80O91963lkz4eXE djfPHbmik39EJYLKQ1R0S+LNbfLlHR97/RIaqEJ9/dVontm+rmRw34XReEAqiXpPCbAaPq0dy12JY 4+KRCCw3CENPRUkFlrXNQvuHbtvo6VeGHT2UfvWcTZ6ooFBvXfLyD2hlkjpUzOHz3bOs=; 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:Cc:To:From:Sender:Reply-To: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=RKaFlOy8tHZCW3OqqfxXShSKzA/9NNHXYcqOxN0wmmo=; b=kRP0ZfiuE16gHiryFx1wG0Vgau fA3t0jONtn5/CtYb+eMWx+LvE7mbka5zlgV8QiRaMTVAM/0jmgsWaqtVvRu5CI6XZ7RbzBIhxMnmY 3+jW8kD12Iarl7L+uHzSMQeG5ai8Qkpka4t/R5uerU+wLWELnma3FzQKzYjE7Kr2W6zQ=; Received: from mout-p-201.mailbox.org ([80.241.56.171]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vGEXA-0006bR-Lb for openvpn-devel@lists.sourceforge.net; Tue, 04 Nov 2025 10:45:06 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (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) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4d14pT6J7Hz9scb; Tue, 4 Nov 2025 11:44:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1762253089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RKaFlOy8tHZCW3OqqfxXShSKzA/9NNHXYcqOxN0wmmo=; b=wVZ6JHvOE1wufLGMEeEJUnpt9liiBVNzkkNcwmAMSqFl91skWamAaEyYh6n4jVdikEKNIs r++DoZRMiVQ7q2DL/TC3eqGtOJkiPy2GeIuE/viIFFkuUuAitqfblce3PcClAX7MZ8vAgb WAIuubbTJV1MKr5CB+ppVuRbRrKuHRvaKa1M8flPbQ7GgWD7Un+kRFpVvJ5z2J+tRC1iW8 Jda8Qujf4S4ZEBvtR+tyM9SG15Nz5IJsm2OqTaXdqEwU7nRnEiIFBrJitRuJzSut1LPAbq 9TgazscDZ21Q6g353EGickiXaI3BdBWo1+zR/Xr3uTrZWhzE7QOaMQg8hQb9ng== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of frank@lichtenheld.com designates 2001:67c:2050:b231:465::1 as permitted sender) smtp.mailfrom=frank@lichtenheld.com From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Tue, 4 Nov 2025 11:44:48 +0100 Message-Id: <20251104104448.98093-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4d14pT6J7Hz9scb X-Spam-Score: -0.2 (/) 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: Antonio Quartulli A bunch of functions are defined and used within init.c only. We can therefore drop their declaration in init.h and make them static. Change-Id: I2b5429841bcd46376241890ace50b82a291b7400 Signed-off-by: Antonio Quartulli Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-Headers-End: 1vGEXA-0006bR-Lb Subject: [Openvpn-devel] [PATCH v1] init: make some functions static 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: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1847856320410882424?= X-GMAIL-MSGID: =?utf-8?q?1847856320410882424?= From: Antonio Quartulli A bunch of functions are defined and used within init.c only. We can therefore drop their declaration in init.h and make them static. Change-Id: I2b5429841bcd46376241890ace50b82a291b7400 Signed-off-by: Antonio Quartulli Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1346 --- 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/+/1346 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 1bdaf27..8d95d5c 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -71,13 +71,13 @@ static bool do_deferred_p2p_ncp(struct context *c); -void +static void context_clear(struct context *c) { CLEAR(*c); } -void +static void context_clear_1(struct context *c) { CLEAR(c->c1); @@ -4430,32 +4430,9 @@ } /* - * Initialize a tunnel instance, handle pre and post-init - * signal settings. - */ -void -init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags) -{ - pre_init_signal_catch(); - init_instance(c, env, flags); - post_init_signal_catch(); - - /* - * This is done so that signals thrown during - * initialization can bring us back to - * a management hold. - */ - if (IS_SIG(c)) - { - remap_signal(c); - uninit_management_callback(); - } -} - -/* * Initialize a tunnel instance. */ -void +static void init_instance(struct context *c, const struct env_set *env, const unsigned int flags) { const struct options *options = &c->options; @@ -4745,6 +4722,29 @@ } /* + * Initialize a tunnel instance, handle pre and post-init + * signal settings. + */ +void +init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags) +{ + pre_init_signal_catch(); + init_instance(c, env, flags); + post_init_signal_catch(); + + /* + * This is done so that signals thrown during + * initialization can bring us back to + * a management hold. + */ + if (IS_SIG(c)) + { + remap_signal(c); + uninit_management_callback(); + } +} + +/* * Close a tunnel instance. */ void diff --git a/src/openvpn/init.h b/src/openvpn/init.h index e89615b..97318ec 100644 --- a/src/openvpn/init.h +++ b/src/openvpn/init.h @@ -31,10 +31,6 @@ */ #define BASE_N_EVENTS 5 -void context_clear(struct context *c); - -void context_clear_1(struct context *c); - void context_clear_2(struct context *c); void context_init_1(struct context *c); @@ -64,8 +60,6 @@ void init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags); -void init_instance(struct context *c, const struct env_set *env, const unsigned int flags); - /** * Query for private key and auth-user-pass username/passwords. */