diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2023-10-21 19:06:38 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2023-10-21 19:06:38 +0200 |
commit | f502ec3fad116d11109529bcf283e464f4822c18 (patch) | |
tree | 034d378d38f9ecf48894c0a380a028f2ca085666 /conn | |
parent | 5d37bd24e14e3fff6c1ce61e299480beb3d68c00 (diff) |
conn: fix cmsg data padding calculation for gso
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'conn')
-rw-r--r-- | conn/gso_linux.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/conn/gso_linux.go b/conn/gso_linux.go index b8599ce..8596b29 100644 --- a/conn/gso_linux.go +++ b/conn/gso_linux.go @@ -56,7 +56,7 @@ func setGSOSize(control *[]byte, gsoSize uint16) { hdr.Level = unix.SOL_UDP hdr.Type = unix.UDP_SEGMENT hdr.SetLen(unix.CmsgLen(sizeOfGSOData)) - copy((gsoControl)[unix.SizeofCmsghdr:], unsafe.Slice((*byte)(unsafe.Pointer(&gsoSize)), sizeOfGSOData)) + copy((gsoControl)[unix.CmsgLen(0):], unsafe.Slice((*byte)(unsafe.Pointer(&gsoSize)), sizeOfGSOData)) *control = (*control)[:existingLen+space] } |