aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/TunnelViewModel.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-10-24 19:01:33 +0530
committerRoopesh Chander <roop@roopc.net>2018-10-27 15:13:01 +0530
commit7316eb06f824662fb47355e889940e15b0f39e43 (patch)
tree71ad2101e3eb2172f39dabaccb31b67b3c521903 /WireGuard/WireGuard/UI/TunnelViewModel.swift
parentVPN: Tunnel container shall provide direct access to the configuration object (diff)
downloadwireguard-apple-7316eb06f824662fb47355e889940e15b0f39e43.tar.xz
wireguard-apple-7316eb06f824662fb47355e889940e15b0f39e43.zip
Model: MTU should be a 16-bit integer
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/TunnelViewModel.swift')
-rw-r--r--WireGuard/WireGuard/UI/TunnelViewModel.swift4
1 files changed, 2 insertions, 2 deletions
diff --git a/WireGuard/WireGuard/UI/TunnelViewModel.swift b/WireGuard/WireGuard/UI/TunnelViewModel.swift
index cb678d1..bc826d5 100644
--- a/WireGuard/WireGuard/UI/TunnelViewModel.swift
+++ b/WireGuard/WireGuard/UI/TunnelViewModel.swift
@@ -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] {