Skip to content

Commit cff909a

Browse files
committed
Raise a critical error if the DHCP detector can't be started
1 parent 08fc560 commit cff909a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

dnscrypt-proxy/plugin_forward.go

+6
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,18 @@ func (plugin *PluginForward) Init(proxy *Proxy) error {
128128
if proxy.SourceIPv6 {
129129
dlog.Notice("Starting a DHCP/DNS detector for IPv6")
130130
d6 := &dhcpdns.Detector{RemoteIPPort: "[2001:DB8::53]:80"}
131+
if err := d6.Detect(); err != nil {
132+
dlog.Criticalf("Failed to start the DHCP/DNS IPv6 server: %s", err)
133+
}
131134
go d6.Serve(9, 10)
132135
plugin.dhcpdns = append(plugin.dhcpdns, d6)
133136
}
134137
if proxy.SourceIPv4 {
135138
dlog.Notice("Starting a DHCP/DNS detector for IPv4")
136139
d4 := &dhcpdns.Detector{RemoteIPPort: "192.0.2.53:80"}
140+
if err := d4.Detect(); err != nil {
141+
dlog.Criticalf("Failed to start the DHCP/DNS IPv4 server: %s", err)
142+
}
137143
go d4.Serve(9, 10)
138144
plugin.dhcpdns = append(plugin.dhcpdns, d4)
139145
}

0 commit comments

Comments
 (0)