mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2025-06-05 04:43:44 +02: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue