From patchwork Tue Jun 17 08:41:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4282 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7001:602d:b0:668:42a9:9967 with SMTP id us45csp2331368mab; Tue, 17 Jun 2025 01:41:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWbXgEJO8bRImCgn2So3dlSeC5CpdEyGju3XAN5S90a5A2E3mT+8mMR8vgO2dCmWND+bJ4Uor3KVSM=@openvpn.net X-Google-Smtp-Source: AGHT+IHu2xauLEcxg2pWZR5eRFd13UyPayrHqiZMJG57NidhQMFCMjQZDzV50SH4PnKNRYSj5EVj X-Received: by 2002:a92:c242:0:b0:3dd:c1d1:b6b3 with SMTP id e9e14a558f8ab-3de22cc985bmr16201715ab.6.1750149717031; Tue, 17 Jun 2025 01:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750149717; cv=none; d=google.com; s=arc-20240605; b=hXelfzUQnyVJ3QpY38yeMaAARSfdCa+KlbkfM1C/3yifp8dgGFzLj0CnSoHzV9rLkR AkxGmRuahNOt9sg2COwPqet13eERBGgqHSQwm1gcEt96TuPdg5sY90dU0tJMzl8wwUVe 3/2ErMBWgZ46PEaoq+KEqdkaZHxvMJs8vaeozQYiC1hTwX6QJdFiELGUb8leFtIVVu1R D4ue2IrzjJDkPAtSXneTztxDuFn5AhyGMxqjMFnYNuuik/dS0am4128RjJ9prostjubq haVe6WslB+ytYlL1NtTzF2DfN0vTQan/xVqy1tEMsGIljk/R4Nqx0HQwZwIOWRPiXhV9 x8AQ== 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; bh=hOWL8S8+sZ4qwu7Vksak4YrDJCAseA11gtUaqQyiiCI=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=cxOF0gNrDOLzFYxHA4d8uh+wdDNvQ6w+Wtt3+KQXFjuA6LrU1PaW+4I+EH5hc4xIJw MPEpiF5PqIikuhlupSuyFcHwMBZ17pZA5UqNHI2Ax2te6/JJpyquz8XmuBL2ZivXHP8u JQwB5zfeRfLI6ie4XAIDIjjRnKzm++2bOnyRCQ4TjQux9yQdGmQa/5DnJ1Xwu38WK12u r14G6plS4/aH8sihY83CTbw8qYSTWPwlI3sFH4DkvqPq23Dac+bM4djW0mUEbN70nr8D dcn5UclW4XWkXBUxzH+6cG/htqnB8es8THXxWuAr1yt2v2GdBAb1+LLPsSjU0GFtWB9i Ydag==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=kYmX7D1b; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=jcYxsJCh; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=VCdf0E8v; 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 e9e14a558f8ab-3de019bc40csi119005845ab.65.2025.06.17.01.41.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jun 2025 01:41:56 -0700 (PDT) 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=kYmX7D1b; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=jcYxsJCh; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=VCdf0E8v; 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-Owner; bh=hOWL8S8+sZ4qwu7Vksak4YrDJCAseA11gtUaqQyiiCI=; b=kYmX7D1bgCfuHJHiNalyQW0uhH x8joxpHnieZ7uB0O4DxKZ+7Znj9gSBcvt2etmgQoh350GdPE/Rrl8abPUcx0JfHmTFcX6Ds/vUMjV 6iByuGqVgZ2qtMQIa3UfQfVQeai1kqBg8BknAH5uYdcN3g8bHQ3s+rAK0JKrMXg3Ju28=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1uRRtA-0007Un-5m; Tue, 17 Jun 2025 08:41:52 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1uRRt8-0007UJ-0k for openvpn-devel@lists.sourceforge.net; Tue, 17 Jun 2025 08:41:50 +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=HNBQGKyMN20oFaWebZY90eDa5XcK+Zthrrn7EBKYIJ0=; b=jcYxsJChAVo2BlyG5mpAC3ntWP IiNoyF98D9Q68whkUYejCLKPydrLcvG9RP/vkMY/zJtPyglcibQ7/29zdAS9rzihjGL+dTu+tmDoJ mUrU+PO0GXHpktM8tFUPTqO1GcW3Kh2Nh0ta4W4yDjaWa8ie6pqO/3poKxg3HCP4pOXo=; 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=HNBQGKyMN20oFaWebZY90eDa5XcK+Zthrrn7EBKYIJ0=; b=VCdf0E8vFCIJbZ4L2bE2+fqFae dBbutdbhW3OCdmDp1GeSEwQvf10H1Kzk09QFpbm596P67lntyfgl7Ph8u/MtAgHMOClXaxKqZimoa KS8uT+Smffjno7CesaYuHemXm6nku1ja330AnWZKgLeETELQYzr4TkATVTYKwedl9xxk=; Received: from [193.149.48.143] (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 1uRRt6-00061H-SL for openvpn-devel@lists.sourceforge.net; Tue, 17 Jun 2025 08:41:49 +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 55H8faSi010267 for ; Tue, 17 Jun 2025 10:41:36 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 55H8faPN010266 for openvpn-devel@lists.sourceforge.net; Tue, 17 Jun 2025 10:41:36 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 17 Jun 2025 10:41:28 +0200 Message-ID: <20250617084136.10215-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.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: Ralf Lici During a float operation, we remove the old `mroute` object corresponding to the current multi instance from the hash table and insert a new one. With the introduction of the multi-socket feature, the [...] 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: 1uRRt6-00061H-SL Subject: [Openvpn-devel] [PATCH v1] Preserve socket protocol during float processing 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?1835164989898340626?= X-GMAIL-MSGID: =?utf-8?q?1835164989898340626?= From: Ralf Lici During a float operation, we remove the old `mroute` object corresponding to the current multi instance from the hash table and insert a new one. With the introduction of the multi-socket feature, the `mroute` structure gained a `proto` field, which must also be set in the new instance, otherwise, hash table lookups will fail. This commit ensures that the `proto` field is propagated from the original to the new `mroute` object during float processing. Change-Id: I0e17d9aea32eab7f44ed95037f077ae6dec52053 Signed-off-by: Ralf Lici Acked-by: Gianmarco De Gregori --- 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/+/1063 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gianmarco De Gregori diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 169af43..a760e07 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3217,6 +3217,12 @@ struct hash *hash = m->hash; struct gc_arena gc = gc_new(); + if (mi->real.type & MR_WITH_PROTO) + { + real.type |= MR_WITH_PROTO; + real.proto = sock->info.proto; + } + if (!mroute_extract_openvpn_sockaddr(&real, &m->top.c2.from.dest, true)) { goto done;