Update gVisor to release-20230605.0-21-g457c1c36d
This commit is contained in:
parent
b02f252916
commit
e881f21013
20 changed files with 71 additions and 550 deletions
|
|
@ -24,7 +24,7 @@ import (
|
|||
"github.com/sagernet/sing-tun/internal/fdbased/stopfd"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
"gvisor.dev/gvisor/pkg/bufferv2"
|
||||
"gvisor.dev/gvisor/pkg/buffer"
|
||||
"gvisor.dev/gvisor/pkg/tcpip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/header"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/link/rawfile"
|
||||
|
|
@ -135,7 +135,7 @@ type packetMMapDispatcher struct {
|
|||
|
||||
func (*packetMMapDispatcher) release() {}
|
||||
|
||||
func (d *packetMMapDispatcher) readMMappedPacket() (*bufferv2.View, bool, tcpip.Error) {
|
||||
func (d *packetMMapDispatcher) readMMappedPacket() (*buffer.View, bool, tcpip.Error) {
|
||||
hdr := tPacketHdr(d.ringBuffer[d.ringOffset*tpFrameSize:])
|
||||
for hdr.tpStatus()&tpStatusUser == 0 {
|
||||
stopped, errno := rawfile.BlockingPollUntilStopped(d.EFD, d.fd, unix.POLLIN|unix.POLLERR)
|
||||
|
|
@ -159,7 +159,7 @@ func (d *packetMMapDispatcher) readMMappedPacket() (*bufferv2.View, bool, tcpip.
|
|||
}
|
||||
|
||||
// Copy out the packet from the mmapped frame to a locally owned buffer.
|
||||
pkt := bufferv2.NewView(int(hdr.tpSnapLen()))
|
||||
pkt := buffer.NewView(int(hdr.tpSnapLen()))
|
||||
pkt.Write(hdr.Payload())
|
||||
// Release packet to kernel.
|
||||
hdr.setTPStatus(tpStatusKernel)
|
||||
|
|
@ -191,7 +191,7 @@ func (d *packetMMapDispatcher) dispatch() (bool, tcpip.Error) {
|
|||
}
|
||||
|
||||
pbuf := stack.NewPacketBuffer(stack.PacketBufferOptions{
|
||||
Payload: bufferv2.MakeWithView(pkt),
|
||||
Payload: buffer.MakeWithView(pkt),
|
||||
})
|
||||
defer pbuf.DecRef()
|
||||
if d.e.hdrSize > 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue