Fix gVisor UDP

This commit is contained in:
世界 2023-07-25 08:12:56 +08:00
parent 28db424ae8
commit 688d4da4b7
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -47,7 +47,7 @@ func (f *UDPForwarder) HandlePacket(id stack.TransportEndpointID, pkt stack.Pack
} else { } else {
f.cacheProto = header.IPv6ProtocolNumber f.cacheProto = header.IPv6ProtocolNumber
} }
gBuffer := pkt.ToBuffer() gBuffer := pkt.Data().ToBuffer()
sBuffer := buf.NewSize(int(gBuffer.Size())) sBuffer := buf.NewSize(int(gBuffer.Size()))
gBuffer.Apply(func(view *buffer.View) { gBuffer.Apply(func(view *buffer.View) {
sBuffer.Write(view.AsSlice()) sBuffer.Write(view.AsSlice())