Skip to content

Commit 42e5cf4

Browse files
committed
Fix udp/icmp not work on gso with system stack
1 parent 864d054 commit 42e5cf4

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tun_linux.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/metacubex/sing-tun/internal/gtcpip/checksum"
1717
"github.com/metacubex/sing-tun/internal/gtcpip/header"
1818
"github.com/metacubex/sing/common"
19-
"github.com/metacubex/sing/common/buf"
2019
"github.com/metacubex/sing/common/control"
2120
E "github.com/metacubex/sing/common/exceptions"
2221
"github.com/metacubex/sing/common/rw"
@@ -148,10 +147,7 @@ func handleVirtioRead(in []byte, bufs [][]byte, sizes []int, offset int) (int, e
148147

149148
func (t *NativeTun) Write(p []byte) (n int, err error) {
150149
if t.vnetHdr {
151-
buffer := buf.Get(virtioNetHdrLen + len(p))
152-
copy(buffer[virtioNetHdrLen:], p)
153-
_, err = t.BatchWrite([][]byte{buffer}, virtioNetHdrLen)
154-
buf.Put(buffer)
150+
_, err = t.BatchWrite([][]byte{p}, virtioNetHdrLen)
155151
if err != nil {
156152
return
157153
}

0 commit comments

Comments
 (0)