mirror of
https://github.com/caddyserver/caddy.git
synced 2025-12-08 06:09:53 +00:00
always continue if addrok
This commit is contained in:
parent
264e9b7fde
commit
ceb5cd1e5d
1 changed files with 16 additions and 18 deletions
|
|
@ -357,39 +357,37 @@ func (st *ServerType) listenersForServerBlockAddress(sblock serverBlock, addr Ad
|
||||||
|
|
||||||
lnIfaceAddresses := []string{}
|
lnIfaceAddresses := []string{}
|
||||||
for _, ifaceAddress := range ifaceAddresses {
|
for _, ifaceAddress := range ifaceAddresses {
|
||||||
var (
|
var addrok, netwok bool
|
||||||
ip net.IP
|
|
||||||
ipok bool
|
var ip net.IP
|
||||||
)
|
|
||||||
switch ifaceAddressValue := ifaceAddress.(type) {
|
switch ifaceAddressValue := ifaceAddress.(type) {
|
||||||
case *net.IPAddr:
|
case *net.IPAddr:
|
||||||
ip, ipok = ifaceAddressValue.IP, true
|
ip, addrok, netwok = ifaceAddressValue.IP, true, true
|
||||||
case *net.IPNet:
|
case *net.IPNet:
|
||||||
ip, ipok = ifaceAddressValue.IP, true
|
ip, addrok, netwok = ifaceAddressValue.IP, true, true
|
||||||
case *net.TCPAddr:
|
case *net.TCPAddr:
|
||||||
ip, ipok = ifaceAddressValue.IP, caddy.IsTCPNetwork(lnNetw)
|
ip, addrok, netwok = ifaceAddressValue.IP, true, caddy.IsTCPNetwork(lnNetw)
|
||||||
case *net.UDPAddr:
|
case *net.UDPAddr:
|
||||||
ip, ipok = ifaceAddressValue.IP, caddy.IsUDPNetwork(lnNetw)
|
ip, addrok, netwok = ifaceAddressValue.IP, true, caddy.IsUDPNetwork(lnNetw)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ipok {
|
if addrok {
|
||||||
if caddy.IsIPv4Network(lnNetw) && len(ip) == net.IPv4len || caddy.IsIPv6Network(lnNetw) && len(ip) == net.IPv6len {
|
if netwok {
|
||||||
lnIfaceAddresses = append(lnIfaceAddresses, ip.String())
|
if caddy.IsIPv4Network(lnNetw) && len(ip) == net.IPv4len || caddy.IsIPv6Network(lnNetw) && len(ip) == net.IPv6len {
|
||||||
|
lnIfaceAddresses = append(lnIfaceAddresses, ip.String())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var name string
|
||||||
name string
|
|
||||||
nameok bool
|
|
||||||
)
|
|
||||||
switch ifaceAddressValue := ifaceAddress.(type) {
|
switch ifaceAddressValue := ifaceAddress.(type) {
|
||||||
case *net.UnixAddr:
|
case *net.UnixAddr:
|
||||||
name, nameok = ifaceAddressValue.Name, true
|
name, addrok, netwok = ifaceAddressValue.Name, true, caddy.IsUnixNetwork(lnNetw)
|
||||||
}
|
}
|
||||||
|
|
||||||
if nameok {
|
if addrok {
|
||||||
if caddy.IsUnixNetwork(lnNetw) {
|
if netwok {
|
||||||
lnIfaceAddresses = append(lnIfaceAddresses, name)
|
lnIfaceAddresses = append(lnIfaceAddresses, name)
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue