summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2020-10-02 10:39:38 +0200
committerDavid Lönnhager <david.l@mullvad.net>2020-10-02 10:39:38 +0200
commit1a72258f2135a3504d69a28bbcb6bd5631abbbee (patch)
tree1af1ed15e5ff4aed162975b33f89f1966196d76b
parentaed67583723a327eafe74d6bc7f61e7e1288f28d (diff)
parent418efc3c9e9c3042b0a7d713f8f99e560ee804af (diff)
downloadmullvadvpn-1a72258f2135a3504d69a28bbcb6bd5631abbbee.tar.xz
mullvadvpn-1a72258f2135a3504d69a28bbcb6bd5631abbbee.zip
Merge branch 'linux-improve-error-log'
-rw-r--r--talpid-core/src/routing/linux.rs25
1 files changed, 19 insertions, 6 deletions
diff --git a/talpid-core/src/routing/linux.rs b/talpid-core/src/routing/linux.rs
index abf64c8fe1..025804d3e1 100644
--- a/talpid-core/src/routing/linux.rs
+++ b/talpid-core/src/routing/linux.rs
@@ -450,12 +450,25 @@ impl RouteManagerImpl {
let mut exclusions_route = route.clone();
exclusions_route.table_id = self.split_table_id;
if let Err(error) = self.delete_route(&exclusions_route).await {
- // This may be expected when routes are deleted by the kernel
- log::debug!(
- "Failed to remove exclusions route: {}\n{}",
- exclusions_route,
- error.display_chain(),
- );
+ match error {
+ Error::NetlinkError(rtnetlink::Error::NetlinkError(error)) => {
+ // Not finding the route is expected if the link goes down
+ if error.code != -libc::ESRCH {
+ log::error!(
+ "Failed to remove exclusions route: {}\n{}",
+ exclusions_route,
+ error
+ );
+ }
+ }
+ error => {
+ log::error!(
+ "Failed to remove exclusions route: {}\n{}",
+ exclusions_route,
+ error.display_chain()
+ );
+ }
+ }
}
}