Model: MTU should be a 16-bit integer
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
6cddb9e34b
commit
7316eb06f8
|
@ -18,7 +18,7 @@ struct InterfaceConfiguration: Codable {
|
|||
var privateKey: Data
|
||||
var addresses: [IPAddressRange] = []
|
||||
var listenPort: UInt16? = nil
|
||||
var mtu: UInt64? = nil
|
||||
var mtu: UInt16? = nil
|
||||
var dns: [DNSServer] = []
|
||||
|
||||
var publicKey: Data {
|
||||
|
|
|
@ -134,11 +134,11 @@ class TunnelViewModel {
|
|||
}
|
||||
}
|
||||
if let mtuString = scratchpad[.mtu] {
|
||||
if let mtu = UInt64(mtuString) {
|
||||
if let mtu = UInt16(mtuString) {
|
||||
config.mtu = mtu
|
||||
} else {
|
||||
fieldsWithError.insert(.mtu)
|
||||
errorMessages.append("Interface's MTU should be a number")
|
||||
errorMessages.append("Interface's MTU should be a 16-bit integer (0 to 65535)")
|
||||
}
|
||||
}
|
||||
if let dnsString = scratchpad[.dns] {
|
||||
|
|
Loading…
Reference in New Issue