Diff

net/dns.lua @ 6857:86fcc3fa1a97

net.dns: Use new IPv4-specific socket factory if available (fixes dns on libevent with latest development version of luasocket)
author Kim Alvefur <zash@zash.se>
date Fri, 25 Sep 2015 17:32:13 +0200
parent 6780:647adfd8f738
child 6866:abff7543b79c
line wrap: on
line diff
--- a/net/dns.lua	Fri Sep 25 17:26:47 2015 +0200
+++ b/net/dns.lua	Fri Sep 25 17:32:13 2015 +0200
@@ -620,7 +620,7 @@
 	if peer:find(":") then
 		sock, err = socket.udp6();
 	else
-		sock, err = socket.udp();
+		sock, err = (socket.udp4 or socket.udp)();
 	end
 	if sock and self.socket_wrapper then sock, err = self.socket_wrapper(sock, self); end
 	if not sock then