mirror of
https://github.com/KusakabeShi/EtherGuard-VPN.git
synced 2025-02-26 12:10:48 +01:00
calculatePaddingSize
This commit is contained in:
parent
0258ed4ef0
commit
3940553358
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user