mirror of
https://git.zx2c4.com/wireguard-go
synced 2024-11-15 01:05:15 +01:00
conn: fix cmsg data padding calculation for gso
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
5d37bd24e1
commit
f502ec3fad
@ -56,7 +56,7 @@ func setGSOSize(control *[]byte, gsoSize uint16) {
|
|||||||
hdr.Level = unix.SOL_UDP
|
hdr.Level = unix.SOL_UDP
|
||||||
hdr.Type = unix.UDP_SEGMENT
|
hdr.Type = unix.UDP_SEGMENT
|
||||||
hdr.SetLen(unix.CmsgLen(sizeOfGSOData))
|
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]
|
*control = (*control)[:existingLen+space]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user