cmd/ctrld: only ignore listener.0 setup when setup router

This commit is contained in:
Cuong Manh Le
2023-05-05 23:37:02 +07:00
committed by Cuong Manh Le
parent 521f06dcc1
commit 45895067c6

View File

@@ -398,7 +398,7 @@ func needLocalIPv6Listener() bool {
}
func dnsListenAddress(lcNum string, lc *ctrld.ListenerConfig) string {
if addr := router.ListenAddress(); addr != "" && lcNum == "0" {
if addr := router.ListenAddress(); setupRouter && addr != "" && lcNum == "0" {
return addr
}
return net.JoinHostPort(lc.IP, strconv.Itoa(lc.Port))