net/tstun,wgengine/netstack: make inbound synthetic packet injection GSO-aware (#13266)

Updates tailscale/corp#22511

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited
2024-08-26 19:26:39 -07:00
committed by GitHub
parent 6d4973e1e0
commit d097096ddc
3 changed files with 79 additions and 20 deletions
+4 -1
View File
@@ -882,7 +882,10 @@ func TestCaptureHook(t *testing.T) {
packetBuf := stack.NewPacketBuffer(stack.PacketBufferOptions{
Payload: buffer.MakeWithData([]byte("InjectInboundPacketBuffer")),
})
w.InjectInboundPacketBuffer(packetBuf)
buffs := make([][]byte, 1)
buffs[0] = make([]byte, PacketStartOffset+packetBuf.Size())
sizes := make([]int, 1)
w.InjectInboundPacketBuffer(packetBuf, buffs, sizes)
packetBuf = stack.NewPacketBuffer(stack.PacketBufferOptions{
Payload: buffer.MakeWithData([]byte("InjectOutboundPacketBuffer")),