summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEmīls <emils@mullvad.net>2021-11-30 09:46:40 +0000
committerEmīls <emils@mullvad.net>2021-12-10 09:58:51 +0000
commit89d7d9f386fb41a351bf19d8097df4f21035d7dd (patch)
tree89ed081a423459f4c9ef6a5e6b058b1aa849ce2c
parent77c3edbb6e02065259b26a60c4554116f1fd8dfb (diff)
downloadmullvadvpn-89d7d9f386fb41a351bf19d8097df4f21035d7dd.tar.xz
mullvadvpn-89d7d9f386fb41a351bf19d8097df4f21035d7dd.zip
Update GUI for new error state causes
-rw-r--r--gui/locales/messages.pot8
-rw-r--r--gui/src/main/daemon-rpc.ts4
-rw-r--r--gui/src/shared/daemon-rpc-types.ts2
-rw-r--r--gui/src/shared/notifications/error.ts10
-rw-r--r--mullvad-daemon/src/lib.rs3
5 files changed, 26 insertions, 1 deletions
diff --git a/gui/locales/messages.pot b/gui/locales/messages.pot
index eb403901d0..faf84e7b08 100644
--- a/gui/locales/messages.pot
+++ b/gui/locales/messages.pot
@@ -620,6 +620,10 @@ msgctxt "navigation-bar"
msgid "Settings"
msgstr ""
+msgctxt "notifications"
+msgid " Unable to activate macOS network check module. Close any programs that might be using port 53, or disable \"Allow macOS network check\"."
+msgstr ""
+
#. The system notification displayed to the user when the account credit is close to expiry.
#. Available placeholder:
#. %(duration)s - remaining time, e.g. "2 days"
@@ -678,6 +682,10 @@ msgid "Disconnected and unsecure"
msgstr ""
msgctxt "notifications"
+msgid "Failed to read system DNS configuration."
+msgstr ""
+
+msgctxt "notifications"
msgid "Reconnecting"
msgstr ""
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts
index c12ee53eff..5e5424142d 100644
--- a/gui/src/main/daemon-rpc.ts
+++ b/gui/src/main/daemon-rpc.ts
@@ -827,6 +827,10 @@ function convertFromTunnelStateErrorCause(
}
case grpcTypes.ErrorState.Cause.SPLIT_TUNNEL_ERROR:
return { reason: 'split_tunnel_error' };
+ case grpcTypes.ErrorState.Cause.CUSTOM_RESOLVER_ERROR:
+ return { reason: 'custom_resolver_error' };
+ case grpcTypes.ErrorState.Cause.READ_SYSTEM_DNS_CONFIG:
+ return { reason: 'read_system_dns_config' };
case grpcTypes.ErrorState.Cause.VPN_PERMISSION_DENIED:
// VPN_PERMISSION_DENIED is only ever created on Android
throw invalidErrorStateCause;
diff --git a/gui/src/shared/daemon-rpc-types.ts b/gui/src/shared/daemon-rpc-types.ts
index 8e42147f43..ebe177c69b 100644
--- a/gui/src/shared/daemon-rpc-types.ts
+++ b/gui/src/shared/daemon-rpc-types.ts
@@ -40,6 +40,8 @@ export type ErrorStateCause =
| 'set_dns_error'
| 'start_tunnel_error'
| 'is_offline'
+ | 'custom_resolver_error'
+ | 'read_system_dns_config'
| 'split_tunnel_error';
}
| { reason: 'set_firewall_policy_error'; details: FirewallPolicyError }
diff --git a/gui/src/shared/notifications/error.ts b/gui/src/shared/notifications/error.ts
index 066c9c333e..73de3a9f90 100644
--- a/gui/src/shared/notifications/error.ts
+++ b/gui/src/shared/notifications/error.ts
@@ -138,6 +138,16 @@ function getMessage(errorDetails: IErrorState, accountExpiry?: string): string {
'notifications',
"Your device is offline. Try connecting when it's back online.",
);
+ case 'custom_resolver_error':
+ // TODO: Figure out a better error message to show to users
+ return messages.pgettext(
+ 'notifications',
+ "Failed to start custom resolver, check if there's a service running on port 53.",
+ );
+ case 'read_system_dns_config':
+ // TODO: Figure out a better error message to show to users
+ return messages.pgettext('notifications', 'Failed to read system DNS configuration.');
+
case 'split_tunnel_error':
return messages.pgettext(
'notifications',
diff --git a/mullvad-daemon/src/lib.rs b/mullvad-daemon/src/lib.rs
index 2e1d839da7..ea5cb9d575 100644
--- a/mullvad-daemon/src/lib.rs
+++ b/mullvad-daemon/src/lib.rs
@@ -2740,8 +2740,8 @@ impl TunnelParametersGenerator for MullvadTunnelParametersGenerator {
}
}
-const INCREASED_FILEHANDLE_LIMIT: u64 = 1024;
/// Bump filehandle limit
+#[cfg(target_os = "macos")]
pub fn bump_filehandle_limit() {
let mut limits = libc::rlimit {
rlim_cur: 0,
@@ -2758,6 +2758,7 @@ pub fn bump_filehandle_limit() {
return;
}
+ const INCREASED_FILEHANDLE_LIMIT: u64 = 1024;
// if file handle limit is already big enough, there's no reason to decrease it.
if limits.rlim_cur >= INCREASED_FILEHANDLE_LIMIT {
return;