From patchwork Wed Nov 4 10:54:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5588 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:30a9:b0:118:2077:975e with SMTP id f41csp182929laa; Wed, 4 Nov 2026 02:54:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvBzS9cAEFCkrzKYh2+PFXEWp6VgBud9CAWhfr6qG5qaj1UJbWMtTSBKvlrvbA1t8jhAEBXfnxU5AmfE=@openvpn.net X-Received: by 2002:a05:7022:7f07:b0:1b2:373c:997 with SMTP id a92af1059eb24-1b2373c09a2mr11602921c88.25.1793789682128; Wed, 04 Nov 2026 02:54:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793789682; cv=none; d=google.com; s=arc-20260327; b=YrOCjOqmK+pyu3TySHRM2Tz0K9yOUJhUHwx2B8Qj2ltCFmqYJueXXLEFidlxoGC2/t lZBGsw2qSkbKc8gNSIpRHzjPEPFjRj7thGUMbnuHLUPGXjTsLtmaJP0rz+3OeboQ+bpK mUW5NhkcPoqBfXGoYgGCDeirfZCC5pqRgfPEaRSqgUYWG2nT6dwhQtUW/wldmQGDRsZP b8LpmQLC16i+MJLieV468sdFOyDhqg7pA682Vr/qZUkepqP6log/KBPPPRz2B4boDN0G 42tyUi8BqzjvelRUXsMD2T5ZzuIWJ/90AEema0WTXHM1Ched/JWysCJQVXcO9S/hN/vi x1Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; 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=BejAO3A1mRl6KQhjJ3MbKzp1dFAnP8va/CBpFRbVFTE=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=Cw4XTqL7obz+HULSMN0syCRICDK0lKRw4UTT4GvfjF11fydGtuuS7SNMGLpkU1TP9Q 8tqPH89zyrqGoj9btpUdUNZp71IV6IS+8jzOMl4uRjHUx2ZYG/6PVUu84ysOt4r11yef H9mecNqiil2NXGjBmpm6qpZLKNAeZyjVymLHZwiF6xiMI+00eehu+SFB/E76ylvmqQ+U JZKjZ21VETFri0uk5lEHNanmB4PlXrUyRosGbeoYX2cfWBqwIuyp7ghlYfTqutVmVAce ObXjm4lpC77VniYZWXZbvCJrFxh7ZcUKaNeWCyA0PEH8JDDBtI/SBKynQZTsjZ4v2OI2 o1PQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=iHbgAhIi; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=D3VpJbwn; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=LK6z8f5q; 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 a92af1059eb24-1b245c3f827si6244207c88.40.2026.11.04.02.54.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2026 02:54:42 -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=iHbgAhIi; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=D3VpJbwn; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=LK6z8f5q; 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-Unsubscribe-Post: List-Owner; bh=BejAO3A1mRl6KQhjJ3MbKzp1dFAnP8va/CBpFRbVFTE=; b=iHbgAhIiyzkzAk k/R9p8wuksD5uPuOVKff+9R5/yA05RlOBPNfaVLuUOnpLL0X3ByQwC9cYgiGanNNxBPRIQRfGC4dD izLrLMSXPoSmooOe1QO6UmYMkKpVte4pzDJXoo4ko1Zhq2+8BiA5RFAP04ZNtAKH+kpa9PikhgiFb yyk=; 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.100.1) (envelope-from ) id 1xOYdc-000000005fx-3Yh2; Wed, 04 Nov 2026 10:54:40 +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.100.1) (envelope-from ) id 1xOYdb-000000005fk-2HsK for openvpn-devel@lists.sourceforge.net; Wed, 04 Nov 2026 10:54:39 +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-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2OS6ZPEImavl5Jj+bHdxgCAm6Sl4f1wkJjLestMfdeg=; b=D3VpJbwnSA8q9sFpq6V9s8LjDC 640BAhJinBq0/vF5sAt8wLA6BJcNPV8JHuDRkAFIIxvIdBSSYn3q1F0ZhDtrEFn350LRk/zJrqzt6 ZH2XRrK+eUo7nYENqlwM7HlFp7eRq60VNybMJAaAg53ETAdz41enopuXDz/LFmIlBtDo=; 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-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2OS6ZPEImavl5Jj+bHdxgCAm6Sl4f1wkJjLestMfdeg=; b=LK6z8f5qcvarRJKnqhSm8RGACr 5x3KFTLBSzcksIMoqRLrq1IGzGzgzvZeWy8D3MUJtXFQNAagLXB+VTuSifcsTiZC0MDivrFwhmmmC HKpS82kLvwc2NSInri1vZVscQM/uPy5tH0Su2X04a9m61dW35D1ra18CN1m/XBbBiXBk=; Received: from [193.149.48.129] (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.100.1) id 1xOYda-000000008MX-1SVQ for openvpn-devel@lists.sourceforge.net; Wed, 04 Nov 2026 10:54:39 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 6A4AsV9q007024 for ; Wed, 4 Nov 2026 11:54:31 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6A4AsV2A007023 for openvpn-devel@lists.sourceforge.net; Wed, 4 Nov 2026 11:54:31 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 4 Nov 2026 11:54:25 +0100 Message-ID: <20261104105431.7011-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) 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: Razvan Cojocaru Both lost their last users when 76d11614 ("get_default_gateway() HWADDR overhaul") replaced the SIOCGIFCONF loop with getifaddrs(). Change-Id: I879cd0fe9b1fabb350e1c4558863480064d45903 Signed-off-by: Razvan Cojocaru Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/ [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1xOYda-000000008MX-1SVQ Subject: [Openvpn-devel] [PATCH v1] route: remove unused max() and gc from BSD get_default_gateway() 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: 1880924809300891348 X-GMAIL-MSGID: 1880924809300891348 From: Razvan Cojocaru Both lost their last users when 76d11614 ("get_default_gateway() HWADDR overhaul") replaced the SIOCGIFCONF loop with getifaddrs(). Change-Id: I879cd0fe9b1fabb350e1c4558863480064d45903 Signed-off-by: Razvan Cojocaru Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2123 --- 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/+/2123 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 53550c4..27012f7 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -3322,12 +3322,9 @@ #define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) #endif -#define max(a, b) ((a) > (b) ? (a) : (b)) - void get_default_gateway(struct route_gateway_info *rgi, in_addr_t dest, openvpn_net_ctx_t *ctx) { - struct gc_arena gc = gc_new(); struct rtmsg m_rtmsg; int sockfd = -1; int rtm_addrs; @@ -3529,7 +3526,6 @@ { close(sockfd); } - gc_free(&gc); } /* BSD implementation using routing socket (as does IPv4) @@ -3698,8 +3694,6 @@ } } -#undef max - #elif defined(TARGET_HAIKU) void