mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-05 00:44:10 -04:00
[client] Add flag to configure MTU (#4213)
This commit is contained in:
@@ -75,6 +75,8 @@ type ConfigInput struct {
|
||||
DNSLabels domain.List
|
||||
|
||||
LazyConnectionEnabled *bool
|
||||
|
||||
MTU *uint16
|
||||
}
|
||||
|
||||
// Config Configuration type
|
||||
@@ -141,6 +143,8 @@ type Config struct {
|
||||
ClientCertKeyPair *tls.Certificate `json:"-"`
|
||||
|
||||
LazyConnectionEnabled bool
|
||||
|
||||
MTU uint16
|
||||
}
|
||||
|
||||
var ConfigDirOverride string
|
||||
@@ -493,6 +497,16 @@ func (config *Config) apply(input ConfigInput) (updated bool, err error) {
|
||||
updated = true
|
||||
}
|
||||
|
||||
if input.MTU != nil && *input.MTU != config.MTU {
|
||||
log.Infof("updating MTU to %d (old value %d)", *input.MTU, config.MTU)
|
||||
config.MTU = *input.MTU
|
||||
updated = true
|
||||
} else if config.MTU == 0 {
|
||||
config.MTU = iface.DefaultMTU
|
||||
log.Infof("using default MTU %d", config.MTU)
|
||||
updated = true
|
||||
}
|
||||
|
||||
return updated, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user