mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-07 00:40:26 +08:00
fix: MTU random range
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user