TUN-6654: Support ICMPv6 on Linux and Darwin

This commit is contained in:
cthuang
2022-09-06 13:46:21 +01:00
parent a65f8bce7f
commit bf3d70d1d2
7 changed files with 232 additions and 68 deletions

View File

@@ -145,6 +145,9 @@ type icmpProxy struct {
}
func newICMPProxy(listenIP netip.Addr, logger *zerolog.Logger, idleTimeout time.Duration) (ICMPProxy, error) {
if listenIP.Is6() {
return nil, fmt.Errorf("ICMPv6 not implemented for Windows")
}
handle, _, err := IcmpCreateFile_proc.Call()
// Windows procedure calls always return non-nil error constructed from the result of GetLastError.
// Caller need to inspect the primary returned value