device: check avaliable connections are really available
authorLubomir Rintel <lkundrak@v3.sk>
Mon, 15 Feb 2016 20:10:26 +0000 (21:10 +0100)
committerLubomir Rintel <lkundrak@v3.sk>
Mon, 15 Feb 2016 20:32:49 +0000 (21:32 +0100)
The nm_device_check_connection_available() call seem to have been accidentally
removed from nm_device_recheck_available_connections() resulting in all
connections always being added.

Fixes 02ec76df5aaa3a3ad197cb1d53c0388029775b07

src/devices/nm-device.c

index ce7e72f..cbcb2c7 100644 (file)
@@ -9354,10 +9354,15 @@ nm_device_recheck_available_connections (NMDevice *self)
                for (iter = connections; iter; iter = g_slist_next (iter)) {
                        connection = NM_CONNECTION (iter->data);
 
-                       if (available_connections_add (self, connection)) {
-                               if (prune_list)
-                                       g_hash_table_remove (prune_list, connection);
-                               changed = TRUE;
+                       if (nm_device_check_connection_available (self,
+                                                                 connection,
+                                                                 NM_DEVICE_CHECK_CON_AVAILABLE_NONE,
+                                                                 NULL)) {
+                               if (available_connections_add (self, connection))
+                                       changed = TRUE;
+                       } else {
+                               if (prune_list && g_hash_table_remove (prune_list, connection))
+                                       changed = TRUE;
                        }
                }