Message ID | 20241115194701.42743-1-shujifurukawa1213@gmail.com |
---|---|
State | Superseded |
Headers | show
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:1ee:b0:5d9:9f4c:3bc7 with SMTP id 14csp1231113map; Fri, 15 Nov 2024 11:47:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXRa9fFjDp15WnuEgk4smkx9Drm/I6xoDwTkkUadjwEq6NBkVbOWTvk2sTPws3LJrlQ+RMueSyGvXM=@openvpn.net X-Google-Smtp-Source: AGHT+IGRbiFDF0D3oSmbg4v0XIfD7fxJPf4RiKOLePi9M1JZXKaPJAagTM/QkqcG53wQcgOtLoRJ X-Received: by 2002:a05:6602:2dc4:b0:83a:c242:82aa with SMTP id ca18e2360f4ac-83e6c315732mr464802139f.13.1731700068065; Fri, 15 Nov 2024 11:47:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731700068; cv=none; d=google.com; s=arc-20240605; b=lg70LfkrDuO/it/ffa4rH3m2L+qJmd80+pYzpsrvP2qXXjvB30djINko88A79av9wD +J9zT5/nzGrMqwCVz4eBb/iebnFzzuUPS7obwXbp0OGZfNqb/xrgdXvCfSPf505Q4len ZSwG3yy1+YoJpjQrY1Yub7SnGgXF9Lh91YPAbK4SoXvbcOU8ZoJUV/Xtd5jmmCiOY0OI zy7uvRITOGv3Dw5DE61P9YdG0Y6yCspOa7EpX4pGP1bKen8B774UZkbU7QpAt4knSKIh v694skSavS2oiRBCnUiTa/8SHw1/NLGfzr2TkMVL+5//6rs5nEt6AHyo/izBvsjPVbvL MDWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:cc:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:dkim-signature :dkim-signature; bh=6BG5iY6GDOmipEJltr3t2UPLtZlxlAEfBhBTgccSqbY=; fh=PL8Gaq/CUo2LaXltYwxkcFfwVlvPtEN/PzCeiK+ADDw=; b=S0dRsp+ZHNixkrC4aArWNpHEC8YBiZB7wQxg7vm6LG/mX1w8/Ki9csrCcQ4pDQA8Zx mAVd+4eT6XjeNCZp6pb6Kk5bsqkYx8iuRPcJ5/JrBa4d7FV2Ni5Um51E3jU/x+KK34Wv fP/dyLn+22i3Ti+FL9o/bBKr2ryaa8SGS6UUjDQUxIsTdf429MifdS92wvU5nKUrHOm1 3WNWxHPZc7FgYow6p63AvlGpoquhAlYpjE29N7SiKtXssO+U/0r0EYnqIgWC05MYn/LD mDCHRSbGEeE3AjmOJSQOeh3LLz0zGJMPsXg5VPoblqgYadIkAYeH8XjjDxcZ9bfrYHRM 6LcA==; 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=W8UN8rRz; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=ekRN6kfB; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=Pp952q+e; 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=QUARANTINE dis=NONE) header.from=gmail.com; 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 8926c6da1cb9f-4e0756bfaa6si1369371173.136.2024.11.15.11.47.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Nov 2024 11:47:48 -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=W8UN8rRz; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=ekRN6kfB; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=Pp952q+e; 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=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@openvpn.net 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.95) (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) id 1tC2I6-0005Pz-Vq; Fri, 15 Nov 2024 19:47:38 +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.95) (envelope-from <shujifurukawa1213@gmail.com>) id 1tC2I5-0005Ps-FR for openvpn-devel@lists.sourceforge.net; Fri, 15 Nov 2024 19:47:36 +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:Message-Id: Date:Subject:Cc:To:From: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-Subscribe:List-Post:List-Owner:List-Archive; bh=yI5g9zvt7XvZ3ire08iD1vpVblTtegpw5Zpf3GFpFmU=; b=W8UN8rRzmIPVQcFO1MtyHZAlnS UCrNJBXtqDtzvmdKjkLn70jLmwafZLRt8eE10mQHdGYXx3fLXf/1l+LdbIcf1jYDZbHEKf3vzLpNp AvFB2WqM61vnb88CjtRHEC6vgDCZuIPzoxJi562s1vd+r8lZvFsn1OIzGq9RT21Dv0jk=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :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-Subscribe:List-Post: List-Owner:List-Archive; bh=yI5g9zvt7XvZ3ire08iD1vpVblTtegpw5Zpf3GFpFmU=; b=e kRN6kfBDF0Hyd4L3zo47cesWNkP7aRyvn7oxeGx6rK4g6lN2sb069WehlkZzmcvBSg177tCzdwTE3 VlYCKXiKM7II5N9DK9H8/ZlJFtktdKkXDkSj0zjf3yMhcGKxeh5ANNBqnfDC2zkhoqlLr8LObGxd3 MYy7R4tH49C0RT/U=; Received: from mail-pl1-f175.google.com ([209.85.214.175]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1tC2I4-0000p8-8z for openvpn-devel@lists.sourceforge.net; Fri, 15 Nov 2024 19:47:36 +0000 Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-21145812538so18129185ad.0 for <openvpn-devel@lists.sourceforge.net>; Fri, 15 Nov 2024 11:47:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731700050; x=1732304850; darn=lists.sourceforge.net; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=yI5g9zvt7XvZ3ire08iD1vpVblTtegpw5Zpf3GFpFmU=; b=Pp952q+eX8l6Z3evi1zvx5S/JBiUBkj0cra+zDOv+3h3f4XbpZAkA1awnzJjh65PD2 z0YtmoAU+sMxAMCcqlxy0Q5BEdkzhDCesiwz63MnXOWY7QDsD+Uic48eMT0efn8jsRu1 hMKPCmF+jpARf8vCC68oFW0v91EKSuHeaYZ2lGT0ieeTwD1b9mP8XzDoKlfMsUyW1IjJ YTGm+WtShbkDeO+ppsxicNun43YNr8scLQ/hmgUS8sE6cFIpu8J8euvqgonBXGczauFM u+GJK7c+JYRcdlyvDlAi+s0C2bLKcTTRF7TVNMsSHHcUuVvYjD1+GP+slUNz76XqtuO8 VJ/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731700050; x=1732304850; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yI5g9zvt7XvZ3ire08iD1vpVblTtegpw5Zpf3GFpFmU=; b=Pb/MjrVvtAbZ0Pmep2RsyURuuGSQ7BrK3gD8jehuQS6I0F843I1ZsTvj5SHHv6g14f N+fhPCe054p2AjABIC0OulTgsCOlFsh0klfiGsXqRP1GKbMP3dcBC5piw1dvqnbv4ocb hdDy7jhlm5oTq4IMCqw4ISfVSRs2bC996D12gNxeACGe+mGRUhcL51jfmC9G2dfPLrtP 8x691JWvPadtQOgJdfLUsqkxkyim8ighW2EJusHGr1MKSCdo2x5X/1QA4cYRmc+9OWTI 7bJP2hBTMlqa8xZcrqR1FPqv4XKJHlUqmKxlsXWDqFyPNBBNgSWjm741t32dfuF/1Kwo fT3Q== X-Gm-Message-State: AOJu0YwJuAJngVVVIQmHdp0kfmFB2QHS/6sklsjVzKm6d81EX2VEfT1M nBOUSyiCWrPi8gAowccN9kyzYaaPhvbdodiZjr2FGbupjCzx9oQa7LmBYg== X-Received: by 2002:a17:902:ce02:b0:20b:ab4b:544a with SMTP id d9443c01a7336-211d0ebc3cemr55362945ad.43.1731700050480; Fri, 15 Nov 2024 11:47:30 -0800 (PST) Received: from localhost.localdomain ([2001:268:98c3:808:6023:9c0:455:8a35]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-211d0f53bf2sm15968175ad.226.2024.11.15.11.47.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 15 Nov 2024 11:47:30 -0800 (PST) From: Hurukawa2121 <shujifurukawa1213@gmail.com> To: openvpn-devel@lists.sourceforge.net Date: Sat, 16 Nov 2024 04:47:02 +0900 Message-Id: <20241115194701.42743-1-shujifurukawa1213@gmail.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) MIME-Version: 1.0 X-Spam-Score: -0.6 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.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: From: Hurukawa2121 --- Improve shuffling algorithm of connection list This patch implements the Fisher-Yates shuffle algorithm to ensure that all permutations of the connection target list are generated with equal probability, eliminating biases present in the previous [...] Content analysis details: (-0.6 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.214.175 listed in list.dnswl.org] 0.0 RCVD_IN_VALIDITY_SAFE_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.214.175 listed in sa-trusted.bondedsender.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [shujifurukawa1213[at]gmail.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [shujifurukawa1213[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 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.214.175 listed in bl.score.senderscore.com] -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_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.7 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.214.175 listed in wl.mailspike.net] X-Headers-End: 1tC2I4-0000p8-8z Subject: [Openvpn-devel] [PATCH] Improve shuffling algorithm of connection list X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: <openvpn-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel> List-Post: <mailto:openvpn-devel@lists.sourceforge.net> List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe> Cc: Hurukawa2121 <shujifurukawa1213@gamil.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1815818427618448736?= X-GMAIL-MSGID: =?utf-8?q?1815819130534550087?= |
Series |
[Openvpn-devel] Improve shuffling algorithm of connection list
|
expand
|
diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 9371024e..3b00b49d 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -478,9 +478,9 @@ init_connection_list(struct context *c) if (c->options.remote_random) { int i; - for (i = 0; i < l->len; ++i) + for (i = l->len - 1; i > 0; --i) { - const int j = get_random() % l->len; + const int j = get_random() % (i + 1); if (i != j) { struct connection_entry *tmp;