ping: Fix unprivileged response on linux

This commit is contained in:
世界
2025-08-24 15:06:09 +08:00
parent 3faf8cf679
commit 8f6cc9f62e
3 changed files with 194 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/sagernet/sing/common/control"
E "github.com/sagernet/sing/common/exceptions"
M "github.com/sagernet/sing/common/metadata"
"golang.org/x/sys/unix"
)
@@ -77,7 +78,7 @@ func connect(privileged bool, controlFunc control.Func, destination netip.Addr)
if err != nil {
return nil, E.Cause(err, "connect()")
}
conn, err := net.FileConn(file)
if err != nil {
return nil, err