mirror of
https://github.com/SagerNet/sing-tun.git
synced 2025-10-07 09:31:11 +08:00
Add ping client
This commit is contained in:
16
ping/cmsg_unix.go
Normal file
16
ping/cmsg_unix.go
Normal file
@@ -0,0 +1,16 @@
|
||||
//go:build !windows
|
||||
|
||||
package ping
|
||||
|
||||
import (
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
func parseIPv6ControlMessage(cmsg []byte) (*ipv6.ControlMessage, error) {
|
||||
var controlMessage ipv6.ControlMessage
|
||||
err := controlMessage.Parse(cmsg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &controlMessage, nil
|
||||
}
|
Reference in New Issue
Block a user