mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
generate alert instead of panic when encountering incorrect listen on port 0 on IPv4 or v6 address (#3172)
This commit is contained in:
parent
b921dcad6c
commit
5ca0f36743
@ -21,6 +21,9 @@ func ListenWithSecuritySettings(ctx context.Context, address net.Address, port n
|
||||
transportListener := transportEnvironment.Listener()
|
||||
|
||||
if port == net.Port(0) { // unix
|
||||
if !address.Family().IsDomain() {
|
||||
return nil, newError("invalid address for unix domain socket: ", address)
|
||||
}
|
||||
listener, err := transportListener.Listen(ctx, &net.UnixAddr{
|
||||
Name: address.Domain(),
|
||||
Net: "unix",
|
||||
|
Loading…
x
Reference in New Issue
Block a user