From patchwork Thu Nov 19 04:40:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Chong <979504756@qq.com> X-Patchwork-Id: 5745 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:b1c3:10b0:11b:d6c:f273 with SMTP id i3-n1csp1101065laq; Wed, 18 Nov 2026 20:40:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErFS5WqNPGhyXUG8FDf52KjZBh6FjYmeaH3z55raYGyWPhOSKxrjSw+SL5fMkYIGX5dyxhPF8D39WAc=@openvpn.net X-Received: by 2002:a05:7022:28b:20b0:16f:c9db:c5af with SMTP id a92af1059eb24-1b543d0c963mr4347116c88.11.1795063227926; Wed, 18 Nov 2026 20:40:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795063227; cv=none; d=google.com; s=arc-20260327; b=lTeQCG41NqJx1ZgJrNdSASLBhSIWib9cI0Gp0CncLmipE7v9HBQDj3OUBzG1wbhyLq NzQlYAXE/URmXBJA86gvq7FtZoVQE7Mn1dtiHxiv6zCc0rcRk4S+cWyqhjfhskOjrCx7 bqZmzqf5gDjaIG7fRoAWT2z6MqKyrHyKMvbKGuOJuJIi1RtYPX8EiUSJGPF6bx3Kuzoe 6BMJ/UjNKgsIsxFVAOY1r5K9wjiHvRGnT6CtjLfjl9GdRMvCdZ1MHUoJs2LFs1tHuBpg Ws0DVGFZ19FmIlWj2rqk4FCXuEAKPD4dIwXBx1rRYZ42nFP5IYUaDd5pXTqadA+f1fYz WLBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=errors-to:content-transfer-encoding:cc:reply-to:from:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:date:to:message-id:dkim-signature :dkim-signature:dkim-signature:dkim-signature; bh=xDE+toaxTqcvx2SxzQ6MoV7eov5nfRZx4oa7s4mgFJI=; fh=JsPJumI5IqCa8v8qOTYWBc/yZAo+FA4sNWPjS2lUaJo=; b=nnYW+DOUhYLq7Z3pl6sT0F7WS02zjrUqg1Aru+KPHFQ3XX2HN3d/IWpyHGqyXFo3V8 SLm16n+6Pvu1i1kE0ws9Y2Xm1YX1uROLB3tuk8pMKN2QEeZ3BfCF1eDmlcS7hj08lhr6 bwscrlDiAp8C4vPEXqHIKr5GkCi1FzlWHfRmQZPGJewSssD4hHHPPn1PR8priqwOMunS j0d7RLLl0Pjex5zX78rMAOmqQYRhxcFEm4BcxetVNUpR7dKDbcoktf0pBw47M7OE0Sfq XGFy9I9o5bPewF2fMyF3vZFbN0iAkWvqSGL/P+q7xcRpRTkOEpt4EIOKVN7XwjFaupmr 8+xg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=Zx4bdrmh; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=QK6aUYup; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=lf8UIEHz; dkim=neutral (body hash did not verify) header.i=@qq.com header.s=s201512 header.b="tLQ+/XQp"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id a92af1059eb24-1b5448f45c6si10433116c88.51.2026.11.18.20.40.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Nov 2026 20:40:27 -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=Zx4bdrmh; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=QK6aUYup; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=lf8UIEHz; dkim=neutral (body hash did not verify) header.i=@qq.com header.s=s201512 header.b="tLQ+/XQp"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=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:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:Date:To:Message-ID:Sender: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=xDE+toaxTqcvx2SxzQ6MoV7eov5nfRZx4oa7s4mgFJI=; b=Zx4bdrmh60esaVIiUn5XE9eDrl 5Pu2we873PQmnC+lbq9UyIzQi26yK8zNjzoGOP60DZdnu9lTgXLtqO4G+Z3LXH+cfk/sXY6/gpC4b 71haL0qeg5AB9+ZzdKALrQb92cCAi77HWTUZY6QePwrzZUdbXhARDN3jec7rCrAYtV3I=; 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.100.1) (envelope-from ) id 1xTtwc-000000000Tc-3CwM; Thu, 19 Nov 2026 04:40:22 +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.100.1) (envelope-from <979504756@qq.com>) id 1xTtwa-000000000TW-29UG for openvpn-devel@lists.sourceforge.net; Thu, 19 Nov 2026 04:40:21 +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:Date:Subject :Cc:To:From:Message-ID:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=s4UjmGAja4Na2Agz89VB7BPgQ6DIhnT7UuqhwEyN1FE=; b=QK6aUYupnEtkhfXkPq3zqDJQeN 8JXUHAF+3LqpkxDtKMQ3kS2utR2UeReesXfgdE4SIDv94pd+dHUB5St6TSEfM1Q0qLKraZk9D5/Db gCRizNOvlRDt2qlAtAbgMbGbFgjuKoucQF6o05rNARmSVWocJKTrA7HHzAraorFLi+V4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Date:Subject:Cc:To:From:Message-ID :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=s4UjmGAja4Na2Agz89VB7BPgQ6DIhnT7UuqhwEyN1FE=; b=lf8UIEHz8w1j0e0SzFMGCqxvU0 X/JvAJZbJvD8/GTzy/51Esbvxt6MMGUibOVQ74k77J4OLOx9XfSv2uoTWw8j03Y38SjzIrwpByBN6 fLalFxmr5w+mHKifKWZ7RerMOcxDUaz5k9eYWwNpHLrC7hz5SLhN4B8nDAaAk051au6k=; Received: from out162-62-57-210.mail.qq.com ([162.62.57.210]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xTtwZ-000000003TI-1DtE for openvpn-devel@lists.sourceforge.net; Thu, 19 Nov 2026 04:40:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1795063209; bh=s4UjmGAja4Na2Agz89VB7BPgQ6DIhnT7UuqhwEyN1FE=; h=From:To:Cc:Subject:Date; b=tLQ+/XQpJCi7A3sl+dEx8WJyD6XpwFhd95fTxKvPzpBmktdvOpTvDnN3ymT315Sy/ 4xBkRCQcd5EWE4X9JubXj+DnTSYEIKY0E5vP/7poQ8PPYx5fqlE2m+sYTpYIyci1yA pcbv7MIFJSRIe1oOQv4iuuLno0Gc5skxa0DEqm/g= Received: from VM-0-17-ubuntu.. ([124.223.3.35]) by newxmesmtplogicsvrszb51-1.qq.com (NewEsmtp) with SMTP id A0804E4C; Thu, 19 Nov 2026 12:40:08 +0800 X-QQ-mid: xmsmtpt1795063208tdyhqva0v Message-ID: X-QQ-XMAILINFO: MRMtjO3A6C9X8Aya9sZPzOzJXi3wQae8u+tPKLi1oS8Ftu45bmt3LNlHpHJ8sl OYjiTfxme3gk45X0OLxZhAgZMQlDyFVsMWK2vMP1eOujrA3B6bxMZv5VFQUZZlhI3cJcZ+vuZGan 8GwxFc90wC91tfdHfECSnCgnjgcVxaxhszGV9aWP35c/7/bCGYdqcEb9fenK9KnfjHVFeY1YNl5R F1nXQ7/Gx0w6du5WVRybzzWUGiK0mJN3Zikl1zN42eKYz/Qv7jaH6aaYPIQSB5NZW4ACWqIKGE6u EqqvH/+fGgRoUQUwRaQTYQR1MmnfYAGPNqbh8p1pmQdYNON2rfHmhuIKuf7TQZNWrQRd31XynNHP Q9xWikxn25cZLjDrJ9Pay40Bjm0wq0cGx/D5X38A4MfVUVEO/Qi6LryBAUbzlhFmyDnkiJvOH9T8 PGulyimBluTeH+6Zt8m46K8waDpVD3dknRqmfDZ3qsGi2Uop429TPGJ1m7mo+n6N6pCMDVV6D6rc B5oHd6Hs2q9GIfUc3LYbZkNWmuFnnV4t+iW9PWgFLNjskhihEsNEoFgh5h+O4knYXdiKbzbilmWq KEX19Yx/B4aUCUmN5Efmb4K3gPtr/nszgQfO6QTqG8bthDnflVrFWDLqnDb9BR8sWcqseQOS37Lc R77TMeAGdN+AzQhubvvqaIQ3SylintxQtOYkf+l+ebr3f1hO9f2Ky1udLB07gdaR9ZqTY3n6nSwp 5brtmzgS8/eFRvDpWvAeQtOroc6MeoejHFiIs/ayZc0y5yWsITmSkH9bGTQGuFMx0D+PnF9XV0OS vifmpimmFaIPIU/spqqE/gjcmKF67p72Ko/955DiCkRqupT0dh67HQ3VUUUv99lDRN4Nen10eayY BEalGnQ9X6Wmyr2Sdty/JNRcaenkA3DaDLY+lMiRCLEeM9Sd47yRaoxucfj/LLfFGxkobBBhj3FT PFUg0WPjtAfRT1Jyp3wt7NcE7qkbNgBx+G3EdPztwC12mPxCJ6BGNiG2G5eIjfcx+bIdZKrFDfS4 Zf/1vBitT/RSZ5Zv9UpB5AudDVofI9OC/wA4d+TQ== X-QQ-XMRINFO: Nq+8W0+stu50tPAe92KXseR0ZZmBTk3gLg== To: openvpn-devel@lists.sourceforge.net Date: Thu, 19 Nov 2026 12:40:08 +0800 X-OQ-MSGID: <20261119044008.3579348-1-979504756@qq.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.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: In ovpn_peer_lookup_vpn_addr6() the word-by-word comparison uses 'continue' on mismatch, but it only skips to the next word of the inner loop, not to the next peer. The comparison therefore has no eff [...] Content analysis details: (1.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 RCVD_IN_UCE2 RBL: IP Subnet Listed in UCEPROTECT Level 2 [124.223.3.35 listed in dnsbl-2.uceprotect.net] 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URI: qq.com] -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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [162.62.57.210 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [979504756(at)qq.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [979504756(at)qq.com] 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [162.62.57.210 listed in list.dnswl.org] -0.0 HELO_STATIC_HOST Relay HELO'd using static hostname 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Headers-End: 1xTtwZ-000000003TI-1DtE Subject: [Openvpn-devel] [PATCH] ovpn-dco: fix IPv6 VPN address comparison in peer lookup 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: , X-Patchwork-Original-From: Liu Chong via Openvpn-devel From: Liu Chong <979504756@qq.com> Reply-To: Liu Chong <979504756@qq.com> Cc: antonio@openvpn.net Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: 1882260219437061804 X-GMAIL-MSGID: 1882260219437061804 In ovpn_peer_lookup_vpn_addr6() the word-by-word comparison uses 'continue' on mismatch, but it only skips to the next word of the inner loop, not to the next peer. The comparison therefore has no effect and the first holdable peer in the bucket is returned even if its IPv6 address does not match. In multi-peer mode a packet can be sent to the wrong peer whenever two IPv6 peers share a hash bucket (with a single peer per bucket the bug is masked). Replace the broken loop with ipv6_addr_equal(), like in the IPv4 lookup path. Fixes: 94581f0cb760 ("ovpn-dco: restructure code to allow supporting multiple link to peers") Signed-off-by: Liu Chong <979504756@qq.com> --- drivers/net/ovpn-dco/peer.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ovpn-dco/peer.c b/drivers/net/ovpn-dco/peer.c index cecbbb4..aee9f11 100644 --- a/drivers/net/ovpn-dco/peer.c +++ b/drivers/net/ovpn-dco/peer.c @@ -355,14 +355,11 @@ static struct ovpn_peer *ovpn_peer_lookup_vpn_addr4(struct hlist_head *head, __b static struct ovpn_peer *ovpn_peer_lookup_vpn_addr6(struct hlist_head *head, struct in6_addr *addr) { struct ovpn_peer *tmp, *peer = NULL; - int i; rcu_read_lock(); hlist_for_each_entry_rcu(tmp, head, hash_entry_addr6) { - for (i = 0; i < 4; i++) { - if (addr->s6_addr32[i] != tmp->vpn_addrs.ipv6.s6_addr32[i]) - continue; - } + if (!ipv6_addr_equal(addr, &tmp->vpn_addrs.ipv6)) + continue; if (!ovpn_peer_hold(tmp)) continue;