NetworkManager r4212 - in trunk: . src



Author: dcbw
Date: Sun Oct 26 15:48:00 2008
New Revision: 4212
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=4212&view=rev

Log:
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)



Modified:
   trunk/ChangeLog
   trunk/src/NetworkManagerPolicy.c

Modified: trunk/src/NetworkManagerPolicy.c
==============================================================================
--- trunk/src/NetworkManagerPolicy.c	(original)
+++ trunk/src/NetworkManagerPolicy.c	Sun Oct 26 15:48:00 2008
@@ -503,10 +503,27 @@
 	}
 	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;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]