32 lines
1.1 KiB
Diff
32 lines
1.1 KiB
Diff
From 7a4a7a1ae01f9ff848b62dfa663703a1ac8b88fd Mon Sep 17 00:00:00 2001
|
|
From: hodbn <hodbn@users.noreply.github.com>
|
|
Date: Fri, 24 Apr 2020 05:50:14 -0700
|
|
Subject: [PATCH] [1.25] Change TARPIT_HOST to detect isolated network (#1862)
|
|
|
|
---
|
|
test/__init__.py | 10 ++++++++--
|
|
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/test/__init__.py b/test/__init__.py
|
|
index 2f6db2e041..01f02738d0 100644
|
|
--- a/test/__init__.py
|
|
+++ b/test/__init__.py
|
|
@@ -19,8 +19,14 @@
|
|
from urllib3.util import ssl_
|
|
|
|
# We need a host that will not immediately close the connection with a TCP
|
|
-# Reset. SO suggests this hostname
|
|
-TARPIT_HOST = "10.255.255.1"
|
|
+# Reset.
|
|
+if platform.system() == "Windows":
|
|
+ # Reserved loopback subnet address
|
|
+ TARPIT_HOST = "127.0.0.0"
|
|
+else:
|
|
+ # Reserved internet scoped address
|
|
+ # https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
|
|
+ TARPIT_HOST = "240.0.0.0"
|
|
|
|
# (Arguments for socket, is it IPv6 address?)
|
|
VALID_SOURCE_ADDRESSES = [(("::1", 0), True), (("127.0.0.1", 0), False)]
|
|
|