From 477cde3a1015870f6249051636692ea7450565fb Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 17 Oct 2018 12:21:49 +0200 Subject: [PATCH] core/trivial: add code comment for nm_manager_get_best_device_for_connection() (cherry picked from commit c37b028abad9105525a5f12dd833fe6592cd0b95) --- src/nm-manager.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 1e610838b6..c7f330c04c 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -3486,13 +3486,23 @@ found_better: /* determine the priority of this device. Currently this priority is independent * of the profile (connection) and the device's details (aside the state). + * * Maybe nm_device_check_connection_available() should instead return a priority, - * as it has more information available. For now, that is not needed nor implemented. */ + * as it has more information available. + * + * For example, if you have multiple Wi-Fi devices, currently a user-request would + * also select the device if the AP is not visible. Optimally, if one of the two + * devices sees the AP and the other one doesn't, the former would be preferred. + * For that, the priority would need to be determined by nm_device_check_connection_available(). */ prio = _device_get_activation_prio (device); if ( prio <= best.prio && best.device) { /* we already have a matching device with a better priority. This candidate - * cannot be better. Skip the check. */ + * cannot be better. Skip the check. + * + * Also note, that below we collect the best error message @local_best. + * Since we already have best.device, the error message does not matter + * either, and we can skip nm_device_check_connection_available() altogether. */ continue; }