From 209c0c058acd0f2b987bcf44c80a7b60c82b98b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Fri, 4 Aug 2023 10:17:38 +0800 Subject: [PATCH] fix: MTU random range --- gold/link/send.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gold/link/send.go b/gold/link/send.go index ae256fe..2986469 100644 --- a/gold/link/send.go +++ b/gold/link/send.go @@ -17,7 +17,7 @@ func (l *Link) WriteAndPut(p *head.Packet, istransfer bool) (n int, err error) { logrus.Debugln("[send] count:", sndcnt, ", additional data:", uint16(sndcnt)) mtu := l.mtu if l.mturandomrange > 0 { - mtu -= uint16(rand.Intn(int(l.mturandomrange))) + mtu -= uint16(rand.Intn(int(l.mturandomrange))) & 0xfff8 } if len(p.Data) <= int(mtu) { if !istransfer {