We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
ErrTooManySegments
1 parent 874083d commit d22dc9eCopy full SHA for d22dc9e
src/tun/iface.go
@@ -1,5 +1,11 @@
1
package tun
2
3
+import (
4
+ "errors"
5
+
6
+ wgtun "golang.zx2c4.com/wireguard/tun"
7
+)
8
9
const TUN_OFFSET_BYTES = 80 // sizeof(virtio_net_hdr)
10
11
func (tun *TunAdapter) read() {
@@ -12,6 +18,10 @@ func (tun *TunAdapter) read() {
12
18
for {
13
19
n, err := tun.iface.Read(bufs, sizes, TUN_OFFSET_BYTES)
14
20
if err != nil {
21
+ if errors.Is(err, wgtun.ErrTooManySegments) {
22
+ tun.log.Debugln("TUN segments dropped: %v", err)
23
+ continue
24
+ }
15
25
tun.log.Errorln("Error reading TUN:", err)
16
26
return
17
27
}
0 commit comments