mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-03 17:10:26 +01:00
2008-10-26 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerPolicy.c - (update_routing_and_dns): ignore host routes when determining whether a VPN connection should own the default route (bgo #552594) git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4212 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
0265bfe52d
commit
6d86495f71
2 changed files with 25 additions and 2 deletions
|
|
@ -1,3 +1,9 @@
|
|||
2008-10-26 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/NetworkManagerPolicy.c
|
||||
- (update_routing_and_dns): ignore host routes when determining whether
|
||||
a VPN connection should own the default route (bgo #552594)
|
||||
|
||||
2008-10-24 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/nm-gsm-device.c
|
||||
|
|
|
|||
|
|
@ -503,10 +503,27 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update)
|
|||
}
|
||||
g_slist_free (vpns);
|
||||
|
||||
/* VPNs are the default route only if they don't have custom routes */
|
||||
/* VPNs are the default route only if they don't have custom non-host (ie, /32)
|
||||
* routes. Custom non-host routes are redundant when the VPN is the default
|
||||
* route because any traffic meant for the custom route would be routed over
|
||||
* the VPN anyway.
|
||||
*/
|
||||
if (vpn) {
|
||||
gboolean have_non_host_routes = FALSE;
|
||||
int i;
|
||||
|
||||
ip4_config = nm_vpn_connection_get_ip4_config (vpn);
|
||||
if (nm_ip4_config_get_num_routes (ip4_config) == 0) {
|
||||
for (i = 0; i < nm_ip4_config_get_num_routes (ip4_config); i++) {
|
||||
const NMSettingIP4Route *route = nm_ip4_config_get_route (ip4_config, i);
|
||||
|
||||
if (route->prefix != 32) {
|
||||
have_non_host_routes = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!have_non_host_routes) {
|
||||
NMIP4Config *parent_ip4;
|
||||
NMDevice *parent;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue