summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-15 07:33:10 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-15 07:33:10 +0000
commitfba0b81e183be1e477be8e57779512e876cca02f (patch)
tree5f47b17f75d8ab6ee7f4d6e4a5384a2eed8b8a75 /test
parent0f4d856d4ddd82638f2ee525ddb8fb4fd5dc1a17 (diff)
test/socket/test_basicsocket.rb (socks): bind explicitly to localhost
Binding to a potentially public IP in a test can cause problems if hit by a random port scanner or something... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/socket/test_basicsocket.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/socket/test_basicsocket.rb b/test/socket/test_basicsocket.rb
index 4d11521e9e..0671e97c75 100644
--- a/test/socket/test_basicsocket.rb
+++ b/test/socket/test_basicsocket.rb
@@ -98,7 +98,7 @@ class TestSocket_BasicSocket < Test::Unit::TestCase
end
def socks
- sserv = TCPServer.new(0)
+ sserv = TCPServer.new('localhost', 0)
ssock = nil
t = Thread.new { ssock = sserv.accept }
csock = TCPSocket.new('localhost', sserv.addr[1])