diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb index ad7d1e7aa0ff4a..d079ec508eacab 100644 --- a/ext/socket/lib/socket.rb +++ b/ext/socket/lib/socket.rb @@ -897,6 +897,7 @@ def self.udp_server_sockets(host=nil, port) ip_list << ai end } + ip_list.uniq!{|e| e.to_sockaddr} if port == 0 sockets = ip_sockets_port0(ip_list, false)