From patchwork Fri Dec 19 13:47:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 4692 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7001:148e:b0:7b1:439f:bdf with SMTP id bf14csp213749mac; Fri, 19 Dec 2025 05:47:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU8JuSJiCEIdwn/8gpQQZEdn05vq0Y8qr4qZCucLWpIE7xbY2JyNg/K1x0IstMeCC5TdaPRUBlbj0I=@openvpn.net X-Google-Smtp-Source: AGHT+IE3a+TUWRbGra7WLoph/yminluVKkjZ4xjKKqQFGFLp7QCfun+6fVaF6z+CouvyGDCydneo X-Received: by 2002:a05:6871:5826:b0:3d3:1fc3:c0c6 with SMTP id 586e51a60fabf-3fa166740c5mr2913254fac.1.1766152055741; Fri, 19 Dec 2025 05:47:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1766152055; cv=none; d=google.com; s=arc-20240605; b=EzHbIR2L4cUET+YHehaVUte2Pk8CByYp765a4yVhpSzcGYQkxayahVxqidOsJNbyrx 7AVwQEaxYH+UCHx/xFkf0t3/Cbb3sWeeVohVQ6VTH4KO7CvY97AOekej0wZkaLn2DikB kEAe6lyMPoLkCviknsQHH3lA90ni/+80xYeghUmREz0eayAVFELEC/XLSkkKstethFe/ BvG20XbXLLjnYVsRleFcSVr+cUrCAFW7rH1KhynK9P9SZSX4+7AK7MgqoKFrcah2A2hM sHoq+LctW49WV5MyqFv9Op2XhwedUacARZsMhKNHxRXAQCjJ71anP8Zycjgg04+UK3DV 8R2g== 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:dkim-signature; bh=HxTPN3fy+br7aRNmAPl10MF60JVFkB3PQ2U70EovXAA=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=Yj1wenmH074kBd/sogcFceTBXuaSox7R314WtXn1ocbCFLaooSDYQ9L5fwoe+QMTYl /BzV7iVa4Hvgu7ulwbG4hgDsQ8ace548IJGOclwXKl/CPaEHRmpDwxIJsJeK8UZBcLqt Z0woOrOHA7IPJuxq9p/mGXvRMgAYKEHZR8BIqnG9UClPYU+fJVUeUSZQKweM94DBEtbe TMBgHCOOqkRqn3vZOJEZrZSm2N3sRFGX2e+W0amO1shwBlZwVTuYVLpbKGJZHqIDg3ln V6EhuM/JS5GDfKj+W/5JQqzPi+u8+71ykAge7jaRd4V363GaF9LheNiZ9nD+H5nWz4NN 438g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=mJxWdsYx; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=MsgNf83l; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=M3LzZuXa; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=yTRVlpJ+; 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 586e51a60fabf-3fdaa8d448dsi1894540fac.84.2025.12.19.05.47.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Dec 2025 05:47:35 -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=mJxWdsYx; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=MsgNf83l; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=M3LzZuXa; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=yTRVlpJ+; 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: 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=HxTPN3fy+br7aRNmAPl10MF60JVFkB3PQ2U70EovXAA=; b=mJxWdsYxypBK1QU2n1RjWpQK+T 0fPcj0Ku3DRk/uji3QngkLfUeWFyjMvma4K5bciyGDYMdZ0LghZH/2AYT1j8QUA6vijB4yp+wnQ1S i6JmNjvsHUWtylibKG/HzCldIroHEq9WODEsEABP5ov6l2fZ5PvtAlPH2/lk3t+k4vG0=; 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 1vWapN-0001nx-K0; Fri, 19 Dec 2025 13:47:29 +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 1vWapK-0001nl-PF for openvpn-devel@lists.sourceforge.net; Fri, 19 Dec 2025 13:47:28 +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=Z5N3vuO/1ObhEZZswRgv4+dU2xL50NDE7rmhpJfN8dI=; b=MsgNf83l5AP9rLti4tg0BdioQY eH397QqqP6AvWHCSFmJv3ywZPTAfjw2lMfhAgxhyBIJH9MouuDGX1IeCUFsqF/XWdnsAjPYocfLvB z0Dzpal8WXNKjfI9W9vsbNX5o/q950Flg2K+T79rofHNg+Tc5l52rF0tM5ShBx6rzAis=; 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=Z5N3vuO/1ObhEZZswRgv4+dU2xL50NDE7rmhpJfN8dI=; b=M3LzZuXan7+neyFkjpy8rtmBaH YzuB+nhH9kY/0lb5ZvPeSoHUDLpwsdccpk5dqAwYm1CHIzp5lCk4jckQQ+tRd4bwZyMun/LSsmOVS SXcLgNlEO7J3UfR+cZ7FWCPqZD8MbKGPN2fXPdvs88TQZ/Ib7klc3gin1IiFZcpl+Bq8=; Received: from mout-p-102.mailbox.org ([80.241.56.152]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vWapI-0003gt-WF for openvpn-devel@lists.sourceforge.net; Fri, 19 Dec 2025 13:47:26 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (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-102.mailbox.org (Postfix) with ESMTPS id 4dXpk43W31z9tSh; Fri, 19 Dec 2025 14:47:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1766152028; 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=Z5N3vuO/1ObhEZZswRgv4+dU2xL50NDE7rmhpJfN8dI=; b=yTRVlpJ+j2ajholCJcDUhUqdle3Dab+6L2nzrjX1v0BZCD7eJn/moHkTTeVYTnB05YPnCE kGijwHE26aWFyf75kRDbgh5ccLBenk7QL8+Qth77f+Z6TA6YyX0mfKdZ5I7BgcfNjfUzXw /ngtWmKJlK0rYcBSIw6ZLgsgJ9QvnO5Z5yYBb8Qg78Pi5u+JNXaX4f845r84Cs1yR8UBpV JnmErjGRbMUZ+mgvC4z/JxK69XcUxVa9fK8eUL/BHJC7tRhje0IoKdRxPf3uMEnJsWJL9T 6pcEq8vzMbX6JicyifDaPLATuOr2q8LOFTv2JlKt6DMwIpxYio7Wa6Tfi5KkDA== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of frank@lichtenheld.com designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=frank@lichtenheld.com From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Fri, 19 Dec 2025 14:47:06 +0100 Message-ID: <20251219134706.164040-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4dXpk43W31z9tSh 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: Arne Schwabe Add the things we do not use to the print message to avoid ifdefs around the otherwise unused variables. Change-Id: I33d1d04b59c62e87ab61d768a7201124ccdabd07 Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn [...] 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-Headers-End: 1vWapI-0003gt-WF Subject: [Openvpn-devel] [PATCH v5] Fix warnings on Android about unused variables/methods 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?1851944657974962448?= X-GMAIL-MSGID: =?utf-8?q?1851944657974962448?= From: Arne Schwabe Add the things we do not use to the print message to avoid ifdefs around the otherwise unused variables. Change-Id: I33d1d04b59c62e87ab61d768a7201124ccdabd07 Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/894 --- 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/+/894 This mail reflects revision 5 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ce730f6..11c2d65 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -58,7 +58,7 @@ -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=28 \ -DCMAKE_ANDROID_ARCH_ABI=${{ matrix.abi }} \ -DOPENSSL_ROOT_DIR=${VCPKG_INSTALLED_DIR}/${{ matrix.vcpkg_triplet }} \ - -DENABLE_PKCS11=false -DBUILD_TESTING=true -DENABLE_LZO=false -DUSE_WERROR=no + -DENABLE_PKCS11=false -DBUILD_TESTING=true -DENABLE_LZO=false - name: Build OpenVPN Android binary with cmake run: cmake --build openvpn-build diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 770300a..222a0fa 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -102,6 +102,7 @@ #define RTA_SUCCESS 1 /* route addition succeeded */ #define RTA_EEXIST 2 /* route not added as it already exists */ +#ifndef TARGET_ANDROID static bool add_bypass_address(struct route_bypass *rb, const in_addr_t a) { @@ -123,6 +124,7 @@ return false; } } +#endif struct route_option_list * new_route_option_list(struct gc_arena *a) @@ -2035,9 +2037,7 @@ #if !defined(TARGET_AIX) const char *netmask; #endif -#if !defined(TARGET_ANDROID) const char *gateway; -#endif #else /* if !defined(TARGET_LINUX) */ int metric; #endif @@ -2056,10 +2056,8 @@ #if !defined(TARGET_AIX) netmask = print_in_addr_t(r->netmask, 0, &gc); #endif -#if !defined(TARGET_ANDROID) gateway = print_in_addr_t(r->gateway, 0, &gc); #endif -#endif is_local_route = local_route(r->network, r->netmask, r->gateway, rgi); if (is_local_route == LR_ERROR) @@ -2165,9 +2163,13 @@ openvpn_execve_check(&argv, es, 0, "ERROR: OpenBSD/NetBSD route delete command failed"); #elif defined(TARGET_ANDROID) + /* Avoids the unused variables warnings that all other platforms use + * by adding them to the error message. */ msg(D_ROUTE_DEBUG, "Deleting routes on Android is not possible/not " "needed. The VpnService API allows routes to be set " - "on connect only and will clean up automatically."); + "on connect only and will clean up automatically. " + "Tried to delete route %s netmask %s gateway %s", + network, netmask, gateway); #elif defined(TARGET_AIX) { @@ -2349,7 +2351,10 @@ #elif defined(TARGET_ANDROID) msg(D_ROUTE_DEBUG, "Deleting routes on Android is not possible/not " "needed. The VpnService API allows routes to be set " - "on connect only and will clean up automatically."); + "on connect only and will clean up automatically. " + "Tried to delete %s gateway %s", + network, + gateway_needed ? gateway : "(not needed)"); #elif defined(TARGET_HAIKU) /* ex: route delete /dev/net/ipro1000/0 inet6 :: gw beef::cafe prefixlen 64 */ diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 409cecb..263c965 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -1806,7 +1806,7 @@ #endif -#if !(defined(_WIN32) || defined(TARGET_LINUX) || defined(TARGET_SOLARIS)) +#if !(defined(_WIN32) || defined(TARGET_LINUX) || defined(TARGET_SOLARIS) || defined(TARGET_ANDROID)) static void open_tun_generic(const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt) { @@ -1973,7 +1973,6 @@ openvpn_net_ctx_t *ctx) { #define ANDROID_TUNNAME "vpnservice-tun" - struct user_pass up; struct gc_arena gc = gc_new(); bool opentun;