summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2015-02-01 09:09:37 +0100
committerLubomir Rintel <lkundrak@v3.sk>2015-04-03 18:59:33 +0200
commit0e8a14cc5f7028aec65dd058b777689ceb7703fc (patch)
treee5f54ae0ab8ed67ffad86cb69ab540f615b5e787
parent4cb97cf66f175857a1910ee926ea61dc507c08e8 (diff)
downloadNetworkManager-lr/conn-reactivation-bgo730492.tar.gz
cli: don't look up a device for activation request unless we have tolr/conn-reactivation-bgo730492
Let the server decide which device to use if the user didn't explicitly specify the interface, wireless access point or a wimax nsp. The server will just reuse the device for an already active connection or potentially do a better guess. https://bugzilla.gnome.org/show_bug.cgi?id=730492
-rw-r--r--clients/cli/connections.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 6de3440652..9223866216 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -1723,6 +1723,7 @@ find_device_for_connection (NmCli *nmc,
int i, j;
g_return_val_if_fail (nmc != NULL, FALSE);
+ g_return_val_if_fail (iface || ap || nsp, FALSE);
g_return_val_if_fail (device != NULL && *device == NULL, FALSE);
g_return_val_if_fail (spec_object != NULL && *spec_object == NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
@@ -2208,7 +2209,7 @@ nmc_activate_connection (NmCli *nmc,
g_return_val_if_fail (nmc != NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- if (connection) {
+ if (connection && (ifname || ap || nsp)) {
device_found = find_device_for_connection (nmc, connection, ifname, ap, nsp, &device, &spec_object, &local);
/* Virtual connection may not have their interfaces created yet */
@@ -2226,7 +2227,7 @@ nmc_activate_connection (NmCli *nmc,
_("unknown device '%s'."), ifname);
return FALSE;
}
- } else {
+ } else if (!connection) {
g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_NOT_FOUND,
_("neither a valid connection nor device given"));
return FALSE;