From e477d0e126c620e8138dc4aba3cac8d0169f2d2e Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 11 Jun 2022 19:23:58 +0200 Subject: [PATCH] We may not have a configured IP address --- dnscrypt-proxy/plugin_dns64.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dnscrypt-proxy/plugin_dns64.go b/dnscrypt-proxy/plugin_dns64.go index ed5ef588..9957a65b 100644 --- a/dnscrypt-proxy/plugin_dns64.go +++ b/dnscrypt-proxy/plugin_dns64.go @@ -34,7 +34,10 @@ func (plugin *PluginDNS64) Description() string { } func (plugin *PluginDNS64) Init(proxy *Proxy) error { - plugin.ipv4Resolver = proxy.listenAddresses[0] //recursively to ourselves + if len(proxy.listenAddresses) == 0 { + return errors.New("At least one listening IP address must be configured for the DNS64 plugin to work") + } + plugin.ipv4Resolver = proxy.listenAddresses[0] // query is sent to ourselves plugin.pref64Mutex = new(sync.RWMutex) plugin.proxy = proxy