summaryrefslogtreecommitdiffhomepage
path: root/mullvad-daemon
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2021-11-04 16:17:46 +0100
committerDavid Lönnhager <david.l@mullvad.net>2021-11-05 11:37:48 +0100
commit4c0aac29bbfb0277a250ca34f5c19f04afcc01a9 (patch)
tree6a125294f940d549cd28c9904e0eb04c39376ca6 /mullvad-daemon
parent44a4d522af9e8b529a720aae67f2b1c1ad2d5c5b (diff)
downloadmullvadvpn-4c0aac29bbfb0277a250ca34f5c19f04afcc01a9.tar.xz
mullvadvpn-4c0aac29bbfb0277a250ca34f5c19f04afcc01a9.zip
Use const instead of lazily initialized addresses
Diffstat (limited to 'mullvad-daemon')
-rw-r--r--mullvad-daemon/src/lib.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/mullvad-daemon/src/lib.rs b/mullvad-daemon/src/lib.rs
index aa78abbd2a..3bc7b486bc 100644
--- a/mullvad-daemon/src/lib.rs
+++ b/mullvad-daemon/src/lib.rs
@@ -50,7 +50,7 @@ use std::{collections::HashSet, ffi::OsString};
use std::{
marker::PhantomData,
mem,
- net::IpAddr,
+ net::{IpAddr, Ipv4Addr},
path::{Path, PathBuf},
pin::Pin,
sync::{mpsc as sync_mpsc, Arc, Weak},
@@ -84,11 +84,9 @@ const FIRST_KEY_PUSH_TIMEOUT: Duration = Duration::from_secs(5);
/// Delay between generating a new WireGuard key and reconnecting
const WG_RECONNECT_DELAY: Duration = Duration::from_secs(4 * 60);
-lazy_static::lazy_static! {
- static ref DNS_AD_BLOCKING_SERVERS: [IpAddr; 1] = ["100.64.0.1".parse().unwrap()];
- static ref DNS_TRACKER_BLOCKING_SERVERS: [IpAddr; 1] = ["100.64.0.2".parse().unwrap()];
- static ref DNS_AD_TRACKER_BLOCKING_SERVERS: [IpAddr; 1] = ["100.64.0.3".parse().unwrap()];
-}
+const DNS_AD_BLOCKING_SERVERS: [IpAddr; 1] = [IpAddr::V4(Ipv4Addr::new(100, 64, 0, 1))];
+const DNS_TRACKER_BLOCKING_SERVERS: [IpAddr; 1] = [IpAddr::V4(Ipv4Addr::new(100, 64, 0, 2))];
+const DNS_AD_TRACKER_BLOCKING_SERVERS: [IpAddr; 1] = [IpAddr::V4(Ipv4Addr::new(100, 64, 0, 3))];
pub type ResponseTx<T, E> = oneshot::Sender<Result<T, E>>;