mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-07-28 12:54:14 +00:00
UDS: Check address before listen
This commit is contained in:
parent
b6b51c51c8
commit
313feee10d
1 changed files with 3 additions and 0 deletions
|
@ -42,6 +42,9 @@ func ListenTCP(ctx context.Context, address net.Address, port net.Port, streamSe
|
|||
var listener net.Listener
|
||||
var err error
|
||||
if port == net.Port(0) { // unix
|
||||
if !address.Family().IsDomain() {
|
||||
return nil, errors.New("invalid unix listen: ", address).AtError()
|
||||
}
|
||||
listener, err = internet.ListenSystem(ctx, &net.UnixAddr{
|
||||
Name: address.Domain(),
|
||||
Net: "unix",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue