5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-10 05:10:26 +00:00

Use existing constant

This commit is contained in:
Neil Alexander 2019-11-20 22:40:48 +00:00
parent 9fca3640f9
commit d06c40ad19
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -102,7 +102,7 @@ func DefaultName() string {
func DefaultMTU() int { func DefaultMTU() int {
ehbytes := 0 ehbytes := 0
if DefaultIsTAP() { if DefaultIsTAP() {
ehbytes = 14 ehbytes = tun_ETHER_HEADER_LENGTH
} }
return defaults.GetDefaults().DefaultIfMTU - ehbytes return defaults.GetDefaults().DefaultIfMTU - ehbytes
} }
@ -119,7 +119,7 @@ func DefaultIsTAP() bool {
func MaximumMTU(iftapmode bool) int { func MaximumMTU(iftapmode bool) int {
ehbytes := 0 ehbytes := 0
if iftapmode { if iftapmode {
ehbytes = 14 ehbytes = tun_ETHER_HEADER_LENGTH
} }
return defaults.GetDefaults().MaximumIfMTU - ehbytes return defaults.GetDefaults().MaximumIfMTU - ehbytes
} }