Fix udp/icmp not work on gso with system stack
This commit is contained in:
parent
635920688d
commit
3144f43fc2
1 changed files with 1 additions and 5 deletions
|
|
@ -17,7 +17,6 @@ import (
|
||||||
"github.com/sagernet/sing-tun/internal/gtcpip/checksum"
|
"github.com/sagernet/sing-tun/internal/gtcpip/checksum"
|
||||||
"github.com/sagernet/sing-tun/internal/gtcpip/header"
|
"github.com/sagernet/sing-tun/internal/gtcpip/header"
|
||||||
"github.com/sagernet/sing/common"
|
"github.com/sagernet/sing/common"
|
||||||
"github.com/sagernet/sing/common/buf"
|
|
||||||
"github.com/sagernet/sing/common/control"
|
"github.com/sagernet/sing/common/control"
|
||||||
E "github.com/sagernet/sing/common/exceptions"
|
E "github.com/sagernet/sing/common/exceptions"
|
||||||
"github.com/sagernet/sing/common/rw"
|
"github.com/sagernet/sing/common/rw"
|
||||||
|
|
@ -393,10 +392,7 @@ func handleVirtioRead(in []byte, bufs [][]byte, sizes []int, offset int) (int, e
|
||||||
|
|
||||||
func (t *NativeTun) Write(p []byte) (n int, err error) {
|
func (t *NativeTun) Write(p []byte) (n int, err error) {
|
||||||
if t.vnetHdr {
|
if t.vnetHdr {
|
||||||
buffer := buf.Get(virtioNetHdrLen + len(p))
|
_, err = t.BatchWrite([][]byte{p}, virtioNetHdrLen)
|
||||||
copy(buffer[virtioNetHdrLen:], p)
|
|
||||||
_, err = t.BatchWrite([][]byte{buffer}, virtioNetHdrLen)
|
|
||||||
buf.Put(buffer)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue