summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-07-10 17:47:41 +0200
committerThomas Haller <thaller@redhat.com>2015-07-13 13:39:33 +0200
commit16d0850c37920d01a3d55ddba41325be2e0b719a (patch)
treec163afd72ffd9681c73af1b404f2c40ee09b55c3
parentbefb36691a9336e5e4b80b4f87e5f483da3a4f3f (diff)
downloadNetworkManager-16d0850c37920d01a3d55ddba41325be2e0b719a.tar.gz
default-route-manager: fix handling for absent default routes for VPN
When a VPN has no default route, it is wrong to enforce the absence of a default route on that device. Instead, if there is no default route, NMDefaultRouteManager should just forget about the route. This is especially important, because for VPN types like openswan there is no distinct tunnel interface. Instead, it shares the ifindex with the parent-device. Note that devices usually only enforce their default-route for a short time and afterwards switch to non-synced. If that happens and there is a VPN that enforces the absense of the default route on that device, we end up deleting the default route.
-rw-r--r--src/nm-default-route-manager.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nm-default-route-manager.c b/src/nm-default-route-manager.c
index 0dfe2d52bf..5e7754c72e 100644
--- a/src/nm-default-route-manager.c
+++ b/src/nm-default-route-manager.c
@@ -789,7 +789,13 @@ _ipx_update_default_route (const VTableIP *vtable, NMDefaultRouteManager *self,
}
}
}
- synced = TRUE;
+ if (nm_vpn_connection_get_ip_ifindex (vpn) > 0)
+ synced = TRUE;
+ else {
+ /* a VPN connection without tunnel device cannot have a non-synced, missing default route.
+ * Either it has a default route (which is synced), or it has no entry. */
+ synced = default_route && !never_default;
+ }
}
}