Only add the MTU option to the client config, when it is set.

This commit is contained in:
Marcus Wichelmann 2022-08-05 16:46:47 +02:00
parent 7fd2338278
commit 3ee52c50d7
No known key found for this signature in database
GPG key ID: D9FC1B92E557C80D
2 changed files with 6 additions and 3 deletions

View file

@ -28,7 +28,10 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G
if client.UseServerDNS {
clientDNS = fmt.Sprintf("DNS = %s\n", strings.Join(setting.DNSServers, ","))
}
clientMTU := fmt.Sprintf("MTU = %d\n", setting.MTU)
clientMTU := ""
if setting.MTU > 0 {
clientMTU = fmt.Sprintf("MTU = %d\n", setting.MTU)
}
// Peer section
peerPublicKey := fmt.Sprintf("PublicKey = %s\n", server.KeyPair.PublicKey)