From patchwork Thu Feb 13 15:25:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "stipa (Code Review)" X-Patchwork-Id: 4135 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:1d8f:b0:5e7:b9eb:58e8 with SMTP id hp15csp624960mab; Thu, 13 Feb 2025 07:25:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW58mEs0cC4b8mGkDQ31vyjm274czh5uDBFB3PvOfTNr0ET+jk9tf+gkNiQvjOpVxH5hi6LU9jSlTc=@openvpn.net X-Google-Smtp-Source: AGHT+IGhnfsK05vphXdLhWhZH88zYwFbHdPqGSPgRz2oCfsr6R+BE01YdQgjev9p8bxElPIL3Gil X-Received: by 2002:a05:6e02:160d:b0:3d0:4d38:4e5b with SMTP id e9e14a558f8ab-3d18c32be15mr31621845ab.22.1739460329254; Thu, 13 Feb 2025 07:25:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739460329; cv=none; d=google.com; s=arc-20240605; b=VBPAg016kO+IkG7zw1WzjUe1nVZ1frQUc6+DQTdDx/WgS+0y2Xe3hx4B9vMi7brx1F MI5z/4rU2M8u0lVrWPdPYZyrwYw/p0DsI/3Etg4A3uRJtKiypmBa9F6SZD7KFkJNw+Cr FGLX0iX/l8sIyJ8wI/hMvJUKWFo4dU/hi5RzcYVLkNcwUiUyxuS0lh1P7vFvJ2yVmRiR OKDbnVjGpaBHTK50cZQrfYSB4+zC4EoA6gFrjIiX9e9C3nCT/GOvbFkckc++d5R+m0ap MGPWWA1fmiiDzHxs2UaOwSi9nnkif17KldQCzclnQbOuPAeoAXN0vuInqXcO9we7wau5 IEBQ== 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=6g+sdWa6IxnZ+PhcatXXWD0SWZlja52/FVkIwMAEWdo=; fh=lm0MLPW7DntlrDqRECIiC9JlE1uPxhepE0URYHIf+eE=; b=gPO+5ZTnDhbvydZ5iJqic5OZEhJz60NhD/sf14aRtSLo4It/Cx5M82lR+VcrQ+C9zq lydndo2EPOZ1ccytFytvjXnK/JjopwkrNHcWhqg0y1GSTp8obPHnAE8jdEVzGWXUah2V AeSQOpchgsF7VJCGylu3BPLvrmQOHO0UT6NQ0N0W14ry6ndFyIKpFuZSg1ELa5ILzlnY h/tIL4WziJ5SCqWXFTuojl0tPpZasYCDAZRhkjK+34I6OcymhzM7lkOU3qLbFKRL/awV hNAOsr1RUTCtA1LU0OBVvBYQzlFXa80kjoamzCNXpKmlpcuZKmuB/RGul57s92Daudza gOxQ==; 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=i52+km1q; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Jh9eONG5; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=F4qDD3bF; 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 e9e14a558f8ab-3d18fb8b80csi9264405ab.115.2025.02.13.07.25.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Feb 2025 07:25:29 -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=i52+km1q; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Jh9eONG5; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=F4qDD3bF; 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-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tib5e-0004KL-A0; Thu, 13 Feb 2025 15:25:23 +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 1tib5c-0004KC-Vu for openvpn-devel@lists.sourceforge.net; Thu, 13 Feb 2025 15:25:21 +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=rPRnv1dk8wCW1pRx3pDYMeCDuHWxsXNVBI7vilo8c3M=; b=i52+km1qPZRyPOAve+ZnLga2W3 hgrtEXxpriqunK4Pww/E9aoxFT0tbGrkJxSx6zTAki5To+8d/B4h9KJb63uCCQtsVVKUFVXO0x1Na plWwpi1FpGxffjYZPvXdbm8i5uLK8kLyLUJJTlZlkBkaTNjaiLubD1uJKzimRXA0acXo=; 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=rPRnv1dk8wCW1pRx3pDYMeCDuHWxsXNVBI7vilo8c3M=; b=J h9eONG51YJLRvlnG/Oqi34lJ7zcy3/8xW2w/4FdHKkglgbMoZUwhjN53cJFN3hF7QcJta4a92/MSl QVH0X6wrhaVUGb5oIua3jFA1pBOZhueCQ0UxNw69N/abeNiw4+4K2tFs1pJNaBeO3vc3F+icc8tgJ ept+kPB40EJR0K6k=; Received: from mail-wm1-f52.google.com ([209.85.128.52]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1tib5c-00087a-Ma for openvpn-devel@lists.sourceforge.net; Thu, 13 Feb 2025 15:25:21 +0000 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-43963935585so7184055e9.0 for ; Thu, 13 Feb 2025 07:25:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1739460309; x=1740065109; 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=rPRnv1dk8wCW1pRx3pDYMeCDuHWxsXNVBI7vilo8c3M=; b=F4qDD3bFuPVDnPB9+MRLk64EImycSuFVFbb9MwwM4+jL1brs+uAFYKfZqBcsNejLhw wT1auHxjl7jBHRy4mKzMFf+LuatmtYV3y1zTcDy3SKgZmvhWK2Y3z/1nHNdYMqUzzCXZ OEHoygTmwCKbCi20dEVRjHg2czxlm+7IdJegUk6OlphnX17Kgik5Pv3zvTFZEYZr/PC+ KWHCEZBEw01bfe5jqBcCe7W1LQP+uxP3/umkS+iZteE2Bh6KXyy3pn1jigX8gqtPf4qc /bNr/Aany0DiWB2/pAqzY9KExhublUBzGSj/dK9ermmAlHYXWkpbpukm2kuiXM8wztwx uTzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739460309; x=1740065109; 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=rPRnv1dk8wCW1pRx3pDYMeCDuHWxsXNVBI7vilo8c3M=; b=kqeN1S/kSZzDfMRgxpuASDDk7+MEXYy5CIvv6Tb0meNCgfA71/PlS5lR+N1LRXfFJZ 6LvUIhqxcIHfMe3Qq/3NzSlfLgNgRZr1hXw6SVudi/N0pRX2zd7zXlgrIQ45CkICaoWt 36CpDHx81UWI5+bgY/IQtQgK6NrelWBKoxCdvBLkhfAO0Pj8Xo2XNW9Cc6UvhnKjV7N5 f+j0k7BoMvz06hu93dvYMCCyBwCyhuYD/1VNT15r7omt6bQlSR+sPeKX2Pctg8nTrFJB Pu9kCRNCxNtTIYiqQf7KB/T7LjqHRPLi1fD02praEz/4JpCiEioUTgc3dMYf2foX+6+q Uy2Q== X-Gm-Message-State: AOJu0YylIAL2w2KNSUYRx3Z0zEOxUEECljaNFAIs+xBRwAFRxtFZq3ov 5n0IHc8j1DU+uj2hBqWhLXZbKhLBTQvwRR8IskTxjTiAhndQ7ox8NGZ0bWFPTq81FxrUza35zA7 e X-Gm-Gg: ASbGncubQGm7/3Aw9osqObEMF94hzX3S+9QngBucyBp6bGlhjzKqH+kHTxE9DONfpoy +6GaaaWTA5nBGugtSbxPMvLyoq2P5QWSIFDmZGS0IzngtF6bO0s9i3YK1r9CMgDYHGO1qjMF9qd YLRpcf/proc1gOEDlPiqKMTCgMUYlugam8RT6f8MVcMM8V75T7E4/gORL4XM+5H6CpLzIF9p411 4d4bvP+ibC37TNMneQnmUb4Komb5iaMz7grV1xnf9NCHlWA7WyPEVZJiI3E7r/GVjzADwMNds35 8/f+SQaWIMQ6JcxL0kkA+0Ji74utBY37uvbGFdqqODD72VtJYCFSVU1mDMIvFeApKttAZXA6Szu GrdwlRjw= X-Received: by 2002:a05:600c:46c8:b0:434:ff25:19a0 with SMTP id 5b1f17b1804b1-439581b1d46mr70846475e9.21.1739460308639; Thu, 13 Feb 2025 07:25:08 -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-4395a1aa7bcsm51463735e9.28.2025.02.13.07.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2025 07:25:08 -0800 (PST) From: "plaisthos (Code Review)" X-Google-Original-From: "plaisthos (Code Review)" X-Gerrit-PatchSet: 1 Date: Thu, 13 Feb 2025 15:25:07 +0000 To: flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I33d1d04b59c62e87ab61d768a7201124ccdabd07 X-Gerrit-Change-Number: 894 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: a4e2152038ae94a524b930f711780a88bd7c25d2 References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -0.2 (/) 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: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-0.2 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.52 listed in list.dnswl.org] 0.0 RCVD_IN_VALIDITY_CERTIFIED_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.52 listed in sa-accredit.habeas.com] 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.52 listed in bl.score.senderscore.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.52 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_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_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: 1tib5c-00087a-Ma Subject: [Openvpn-devel] [S] Change in openvpn[master]: 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: , Reply-To: arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1823956354348716327?= X-GMAIL-MSGID: =?utf-8?q?1823956354348716327?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/894?usp=email to review the following change. Change subject: Fix warnings on Android about unused variables/methods ...................................................................... Fix warnings on Android about unused variables/methods The changes to route.c are a bit messy but they mostly modify already existing ifdefs Change-Id: I33d1d04b59c62e87ab61d768a7201124ccdabd07 Signed-off-by: Arne Schwabe --- M src/openvpn/route.c M src/openvpn/tun.c 2 files changed, 13 insertions(+), 8 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/94/894/1 diff --git a/src/openvpn/route.c b/src/openvpn/route.c index d895e1c..1601275 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -104,6 +104,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) { @@ -125,6 +126,7 @@ return false; } } +#endif /* ifndef TARGET_ANDROID */ struct route_option_list * new_route_option_list(struct gc_arena *a) @@ -750,6 +752,7 @@ * (not the most beautiful implementation in the world, but portable and * "good enough") */ +#ifndef TARGET_ANDROID static bool route_ipv6_match_host( const struct route_ipv6 *r6, const struct in6_addr *host ) @@ -785,6 +788,7 @@ return false; } +#endif /* ifndef TARGET_ANDROID */ bool init_route_ipv6_list(struct route_ipv6_list *rl6, @@ -2183,7 +2187,7 @@ const struct env_set *es, openvpn_net_ctx_t *ctx) { -#if !defined(TARGET_LINUX) +#if !defined(TARGET_LINUX) && !defined(TARGET_ANDROID) const char *network; #if !defined(TARGET_AIX) const char *netmask; @@ -2191,9 +2195,11 @@ #if !defined(TARGET_ANDROID) const char *gateway; #endif -#else /* if !defined(TARGET_LINUX) */ +#else /* if !defined(TARGET_LINUX) && !defined(TARGET_ANDROID) */ +#if !defined(TARGET_ANDROID) int metric; #endif +#endif int is_local_route; if ((r->flags & (RT_DEFINED|RT_ADDED)) != (RT_DEFINED|RT_ADDED)) @@ -2204,7 +2210,7 @@ struct gc_arena gc = gc_new(); struct argv argv = argv_new(); -#if !defined(TARGET_LINUX) +#if !defined(TARGET_LINUX) && !defined(TARGET_ANDROID) network = print_in_addr_t(r->network, 0, &gc); #if !defined(TARGET_AIX) netmask = print_in_addr_t(r->netmask, 0, &gc); @@ -2394,10 +2400,10 @@ } #if !defined(_WIN32) -#if !defined(TARGET_LINUX) +#if !defined(TARGET_LINUX) && !defined(TARGET_ANDROID) const char *gateway; #endif -#if !defined(TARGET_SOLARIS) +#if !defined(TARGET_SOLARIS) && !defined(TARGET_ANDROID) bool gateway_needed = false; const char *device = tt->actual_name; if (r6->iface != NULL) /* vpn server special route */ @@ -2421,7 +2427,7 @@ struct argv argv = argv_new(); network = print_in6_addr( r6->network, 0, &gc); -#if !defined(TARGET_LINUX) && !defined(_WIN32) +#if !defined(TARGET_LINUX) && !defined(_WIN32) && !defined(TARGET_ANDROID) gateway = print_in6_addr( r6->gateway, 0, &gc); #endif diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 80f5dff..d2c5191 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -1888,7 +1888,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) @@ -2062,7 +2062,6 @@ openvpn_net_ctx_t *ctx) { #define ANDROID_TUNNAME "vpnservice-tun" - struct user_pass up; struct gc_arena gc = gc_new(); bool opentun;