attempt to improve readability

This commit is contained in:
JackDoan
2026-04-27 10:26:15 -05:00
parent 45bc0fc055
commit 8fdd98f639
2 changed files with 88 additions and 42 deletions

View File

@@ -225,7 +225,6 @@ func (r *Offload) Read() ([][]byte, error) {
// decodeRead decodes the virtio header plus payload in r.readBuf[:n], appends
// the segments to r.pending, and advances r.segOff by the total scratch used.
// Caller must have already ensured r.vnetHdr is true.
func (r *Offload) decodeRead(n int) error {
if n < virtioNetHdrLen {
return fmt.Errorf("short tun read: %d < %d", n, virtioNetHdrLen)