diff --git a/internal/home/config.go b/internal/home/config.go index c553c42c..0bc1145f 100644 --- a/internal/home/config.go +++ b/internal/home/config.go @@ -332,8 +332,14 @@ type tcpPort int // ports should be either a udpPort or a tcpPort. func addPorts(uc aghalg.UniqChecker, ports ...interface{}) { for _, p := range ports { + // Use separate cases for tcpPort and udpPort so that the untyped + // constant zero is converted to the appropriate type. switch p := p.(type) { - case tcpPort, udpPort: + case tcpPort: + if p != 0 { + uc.Add(p) + } + case udpPort: if p != 0 { uc.Add(p) }