We may not have a configured IP address

This commit is contained in:
Frank Denis 2022-06-11 19:23:58 +02:00
parent e24fdd2235
commit e477d0e126
1 changed files with 4 additions and 1 deletions

View File

@ -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