Fix IPv4-only check when no port is specified (#752)
We have behavior that causes "0.0.0.0" to only listen on IPv4, however, it also assumed there was a port suffixed. This changes it so that it also works with a port-less address.
This commit is contained in:
1 parent
1ec3e8276f
commit
f063b8601c
2 files changed
+8
-1
No files matched your search
@@ -156,7 +156,7 @@ func tcpListenerFactory(purpose string, l *configutil.Listener, logger hclog.Log
|
||||
|
||||
// If they've passed 0.0.0.0, we only want to bind on IPv4
|
||||
// rather than golang's dual stack default
|
||||
if strings.HasPrefix(l.Address, "0.0.0.0:") {
|
||||
if strings.HasPrefix(l.Address, "0.0.0.0:") || l.Address == "0.0.0.0" {
|
||||
bindProto = "tcp4"
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user