works well

This commit is contained in:
Ryan
2025-11-04 19:33:52 -05:00
parent aa44f4c7c9
commit 98f264cf14
3 changed files with 116 additions and 9 deletions

View File

@@ -188,8 +188,11 @@ func (w *wireguardTunIO) WriteBatch(packets []*Packet) (int, error) {
w.writeBuffers[i] = pkt.Buf[:limit]
}
n, err := w.dev.Write(w.writeBuffers[:len(packets)], offset)
if err != nil {
return n, err
}
releasePackets(packets)
return n, err
return n, nil
}
func (w *wireguardTunIO) BatchHeadroom() int {