From patchwork Fri Jan 31 08:46:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4111 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:c520:b0:5e7:b9eb:58e8 with SMTP id jx32csp538216mab; Fri, 31 Jan 2025 00:47:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU306DpJoQvk2ksoNs+etLiAQt5wULG3csCXGrUfIihtZsrXtEujz0n67Ylg1pW5cY1C9OV6pQfrG4=@openvpn.net X-Google-Smtp-Source: AGHT+IF90ibizx+MIDOAiXzx0yrwCNtCViy90tD7HeEVBrKdhNmbFwg7WETJisFiaqWB/Aq1MH4w X-Received: by 2002:a05:6808:e84:b0:3ea:5809:2835 with SMTP id 5614622812f47-3f323a77770mr6634225b6e.21.1738313225431; Fri, 31 Jan 2025 00:47:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738313225; cv=none; d=google.com; s=arc-20240605; b=auIrZ1DQiEkd2WmEpDLMOj1Gk8Ce1450MYqqNsN6ya/mmGj97ldXhr1tab8stK4r0n +hDf91pAAeIM0NtstOp0Q6EZiWZyGZBBSEwDRNmUMC+S9FenVBoAKEsI0yN7YNGDGVZm dsY4NfUu8FhDCk7lDCu0mVuSVLoE4feWAn716BwFhrDmV3bsrl/AsGUBvwuCB7+zHaDH 40Cg5wAvIrBa8mxC6GR4KoofcFrsF2d3iGAu41/bNOwT4A0MDBTYEuBxgzxZC3v/lF9z ceGqpE8QlYcryLsxdMTtX7CvwK4H5z0BWhV/2v3d+6C0OdEWpfpYaTZmdCBc0oYUWUJK j6DA== 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; bh=WamoMVXEEv42AJaD1F4dG1ULt0OS7vx9Mi5lqr/n/EE=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=RYq8vxZc6mjXhAhGqA81WGav3H1pBc9bZEBT1WlHuydwGhqBbP4ND5638IICwWgoO6 SVyvqzdI8BGKxdFKficDGxo2mmfWjlap6bGl0UooKTGp5VvCsGQ3I3v6SmsbGdoYqgiZ HRQoxZZiasa6qFfRZdZ1ug2nVoZ6BWi4wxtRs2eoJ+HY4+NXsThnuCplF0x+FkxkSLCe k3DxDV0gYHFBMm+tANr78GF03y2EwuGV5s74Fl1SBXlFYpRpfLKRHoJEplURNlQbT7rW cKnwFeoFKnHNahjAxRkYMU0qgzJDTE3fVhOe+lqQvuATYCCHeKJV/2R/I3iaRbJQuRs0 u+uA==; 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=j4Kec3O7; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=aFYwc6F3; 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 5614622812f47-3f33355dac5si3767983b6e.281.2025.01.31.00.47.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Jan 2025 00:47:05 -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=j4Kec3O7; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=aFYwc6F3; 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 [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 1tdmg2-0004b1-GS; Fri, 31 Jan 2025 08:47:02 +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 1tdmg1-0004al-3g for openvpn-devel@lists.sourceforge.net; Fri, 31 Jan 2025 08:47:01 +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=8jn/myEFsHOxlN7PDsG6keZ/xUTE7O/KVULVTQfvzok=; b=j4Kec3O73zJntBpp+Mmd9gocaP ohZN90vYzF407Id4kunWQkgszykHRYAepej53bWZ6/PkZMVfwlpl6aYqSxLRgsHSiZvyGKCRUQ7TG U6Mk45vyoYaXokBr3uCrzY/rL8nRrNvDqIlLyNDPiz9vt+SEcLxt7tL2fmmq6KNU2ouE=; 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=8jn/myEFsHOxlN7PDsG6keZ/xUTE7O/KVULVTQfvzok=; b=aFYwc6F3dGTeCcJWCc32qXLl68 eEYrVWX9NKsEs5zlaysPjLKjWwvV+CIUN9hbe05sdkuak7Iqm0mD4E0my8eNvxCHuVrftIIJjZwo7 g5dUIU1OAN8tN43XsvSXH105EOV6HL/K1nOOwdPn8kDnriXYYQRfRQCeomPT4ZuPYdZY=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] 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 1tdmfz-0007ms-L7 for openvpn-devel@lists.sourceforge.net; Fri, 31 Jan 2025 08:47:01 +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 50V8kqkK024776 for ; Fri, 31 Jan 2025 09:46:52 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 50V8kq0R024775 for openvpn-devel@lists.sourceforge.net; Fri, 31 Jan 2025 09:46:52 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 31 Jan 2025 09:46:51 +0100 Message-ID: <20250131084651.24765-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 0.0 (/) 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: This adds Linux/SITNL platform functionality to the framework started by commit 9df51cf56 and commit 0fcfc8381f. v2: make comment reflect reality Change-Id: I1db72d7dca648a8ea4ec65d173290a819971305c Signed-off-by: Gert Doering Acked-by: Antonio Quartulli --- Content analysis details: (0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 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. [193.149.48.174 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. [193.149.48.174 listed in bl.score.senderscore.com] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1tdmfz-0007ms-L7 Subject: [Openvpn-devel] [PATCH v2] get_default_gateway(): implement platform support for Linux/SITNL 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?1822753528744519264?= X-GMAIL-MSGID: =?utf-8?q?1822753528744519264?= This adds Linux/SITNL platform functionality to the framework started by commit 9df51cf56 and commit 0fcfc8381f. v2: make comment reflect reality Change-Id: I1db72d7dca648a8ea4ec65d173290a819971305c Signed-off-by: Gert Doering Acked-by: Antonio Quartulli --- 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/+/883 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Antonio Quartulli diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 3501e35..dd37fb9 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -3332,8 +3332,8 @@ CLEAR(*rgi); CLEAR(best_name); - /* get default gateway IP addr */ - if (net_route_v4_best_gw(ctx, NULL, &rgi->gateway.addr, best_name) == 0) + /* find best route to 'dest', get gateway IP addr + interface */ + if (net_route_v4_best_gw(ctx, &dest, &rgi->gateway.addr, best_name) == 0) { rgi->flags |= RGI_ADDR_DEFINED; if (!rgi->gateway.addr && best_name[0])