calculatePaddingSize

This commit is contained in:
Kusakabe Si 2021-12-12 20:23:37 +00:00
parent 0258ed4ef0
commit 3940553358

View File

@ -373,6 +373,7 @@ func (peer *Peer) FlushStagedPackets() {
}
func calculatePaddingSize(packetSize, mtu int) int {
mtu = mtu + 14 + 4 // +Ether frame size + EgHeaderLen
lastUnit := packetSize
if mtu == 0 {
return ((lastUnit + PaddingMultiple - 1) & ^(PaddingMultiple - 1)) - lastUnit