From 5c0e6878e29ac74d16543d0d8094346949bb1620 Mon Sep 17 00:00:00 2001
From: Marek Vavrusa <marek@vavrusa.com>
Date: Wed, 3 Feb 2016 01:20:05 +0000
Subject: [PATCH] daemon/config: bind to v4 and v6 loopback separately

---
 daemon/lua/config.lua | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/daemon/lua/config.lua b/daemon/lua/config.lua
index a417a0b54..dd31cd3b4 100644
--- a/daemon/lua/config.lua
+++ b/daemon/lua/config.lua
@@ -1,8 +1,13 @@
 -- Listen on localhost
 if not next(net.list()) then
-	local ok, err = pcall(net.listen, {'127.0.0.1', '::1'})
+	local ok, err = pcall(net.listen, '127.0.0.1')
 	if not ok then
-		error('bind to localhost#53 '..err)
+		error('bind to 127.0.0.1#53 '..err)
+	end
+	-- IPv6 loopback may fail
+	ok, err = pcall(net.listen, '::1')
+	if not ok and verbose() then
+		print('bind to ::1#53 '..err)
 	end
 end
 -- Open cache if not set/disabled
-- 
GitLab