crash.software
Projects
Pull Requests
Issues
Builds
tun2socks
Code
Files
Commits
Branches
Tags
Pull Requests
Code Comments
Code Compare
Issues
List
Boards
Milestones
Builds
Statistics
Contributions
Source Lines
Child Projects
Projects
STRLCPY
tun2socks
Commits
46c04db2
🤬
Sign In
Fix: tun issue with virtio_net_hdr (
#254
)
xjasonlyu
committed
11 months ago
46c04db2
1 parent
07a6a9f0
Total 2 files
Show one by one
■ ■ ■ ■ ■ ■
core/device/tun/tun_wireguard_linux.go
1
+
//go:build linux && !(amd64 || arm64)
2
+
3
+
package tun
4
+
5
+
import (
6
+
"unsafe"
7
+
)
8
+
9
+
const (
10
+
virtioNetHdrLen = int(unsafe.Sizeof(virtioNetHdr{}))
11
+
offset = virtioNetHdrLen + 0 /* NO_PI */
12
+
defaultMTU = 1500
13
+
)
14
+
15
+
// virtioNetHdr is defined in the kernel in include/uapi/linux/virtio_net.h. The
16
+
// kernel symbol is virtio_net_hdr.
17
+
type virtioNetHdr struct {
18
+
flags uint8
19
+
gsoType uint8
20
+
hdrLen uint16
21
+
gsoSize uint16
22
+
csumStart uint16
23
+
csumOffset uint16
24
+
}
25
+
All occurrences
■
■ ■
■ ■ ■
core/device/tun/tun_wireguard_unix.go
1
-
//go:build unix
1
+
//go:build unix
&
&
!
linux
2
2
3
3
package tun
4
4
5
-
//nolint:all
6
5
const (
7
6
offset = 4 /* 4 bytes TUN_PI */
8
7
defaultMTU = 1500
skipped 2 lines
All occurrences
Please wait...
Page is in error, reload to recover