return error on listening domain address

pull/1511/head^2
Darien Raymond 2019-01-19 10:59:47 +01:00
parent 9a7177c82c
commit aa4ab7fa03
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 4 additions and 0 deletions

View File

@ -40,6 +40,10 @@ func ListenTCP(ctx context.Context, address net.Address, port net.Port, settings
address = net.LocalHostIP
}
if address.Family().IsDomain() {
return nil, newError("domain address is not allowed for listening: ", address.Domain())
}
protocol := settings.ProtocolName
listenFunc := transportListenerCache[protocol]
if listenFunc == nil {