File nm-ignore-virtual-ifindex.patch of Package NetworkManager.openSUSE_12.1_Update

Index: NetworkManager-0.9.1.90/src/nm-device.c
===================================================================
--- NetworkManager-0.9.1.90.orig/src/nm-device.c
+++ NetworkManager-0.9.1.90/src/nm-device.c
@@ -412,7 +412,7 @@ nm_device_set_ip_iface (NMDevice *self,
 	priv->ip_iface = g_strdup (iface);
 	if (priv->ip_iface) {
 		priv->ip_ifindex = nm_netlink_iface_to_index (priv->ip_iface);
-		if (!priv->ip_ifindex) {
+		if (priv->ip_ifindex < 0) {
 			nm_log_warn (LOGD_HW, "(%s): failed to look up interface index", iface);
 		}
 	}
Index: NetworkManager-0.9.1.90/src/vpn-manager/nm-vpn-connection.c
===================================================================
--- NetworkManager-0.9.1.90.orig/src/vpn-manager/nm-vpn-connection.c
+++ NetworkManager-0.9.1.90/src/vpn-manager/nm-vpn-connection.c
@@ -428,9 +428,8 @@ nm_vpn_connection_ip4_config_get (DBusGP
 
 	/* Grab the interface index for address/routing operations */
 	priv->ip_ifindex = nm_netlink_iface_to_index (priv->ip_iface);
-	if (!priv->ip_ifindex) {
-		nm_log_err (LOGD_VPN, "(%s): failed to look up VPN interface index", priv->ip_iface);
-		goto error;
+	if (priv->ip_ifindex < 0) {
+		nm_log_warn (LOGD_VPN, "(%s): failed to look up VPN interface index", priv->ip_iface);
 	}
 
 	addr = nm_ip4_address_new ();
@@ -540,7 +539,12 @@ nm_vpn_connection_ip4_config_get (DBusGP
 
 	nm_system_iface_set_up (priv->ip_ifindex, TRUE, NULL);
 
-	if (nm_system_apply_ip4_config (priv->ip_ifindex, config, 0, NM_IP4_COMPARE_FLAG_ALL)) {
+	/* NOTE:
+	 * Strongswan or Novell VPN doesn't use any tundev or ipsec
+	 * network devices, but handles encryption transparently in
+	 * the networking stack, so need ignore the configuration */
+	if (priv->ip_ifindex <= 0 ||
+			nm_system_apply_ip4_config (priv->ip_ifindex, config, 0, NM_IP4_COMPARE_FLAG_ALL)) {
 		NMDnsManager *dns_mgr;
 
 		/* Add any explicit route to the VPN gateway through the parent device */
openSUSE Build Service is sponsored by