diff --git a/transport/wireguard/device_system.go b/transport/wireguard/device_system.go index 1159f568..4e7c65d0 100644 --- a/transport/wireguard/device_system.go +++ b/transport/wireguard/device_system.go @@ -82,7 +82,7 @@ func (w *SystemDevice) File() *os.File { } func (w *SystemDevice) Read(bytes []byte, index int) (int, error) { - return w.device.Read(bytes[index-tunPacketOffset:]) + return w.device.Read(bytes[index-tun.PacketOffset:]) } func (w *SystemDevice) Write(bytes []byte, index int) (int, error) { diff --git a/transport/wireguard/tun_darwin.go b/transport/wireguard/tun_darwin.go deleted file mode 100644 index 112a8825..00000000 --- a/transport/wireguard/tun_darwin.go +++ /dev/null @@ -1,3 +0,0 @@ -package wireguard - -const tunPacketOffset = 4 diff --git a/transport/wireguard/tun_nondarwin.go b/transport/wireguard/tun_nondarwin.go deleted file mode 100644 index 0f9c53f1..00000000 --- a/transport/wireguard/tun_nondarwin.go +++ /dev/null @@ -1,5 +0,0 @@ -//go:build !darwin - -package wireguard - -const tunPacketOffset = 0