merge: branch 'lr/hotspot-reuse'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/305
This commit is contained in:
@@ -3136,6 +3136,38 @@ activate_update2_cb (GObject *source_object, GAsyncResult *res, gpointer user_da
|
|||||||
info);
|
info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
save_and_activate_connection (NmCli *nmc,
|
||||||
|
NMDevice *device,
|
||||||
|
NMConnection *connection,
|
||||||
|
gboolean hotspot,
|
||||||
|
const char *specific_object)
|
||||||
|
{
|
||||||
|
AddAndActivateInfo *info;
|
||||||
|
|
||||||
|
info = add_and_activate_info_new (nmc, device, hotspot,
|
||||||
|
!NM_IS_REMOTE_CONNECTION (connection),
|
||||||
|
specific_object);
|
||||||
|
|
||||||
|
if (NM_IS_REMOTE_CONNECTION (connection)) {
|
||||||
|
nm_remote_connection_update2 (NM_REMOTE_CONNECTION (connection),
|
||||||
|
nm_connection_to_dbus (connection, NM_CONNECTION_SERIALIZE_ALL),
|
||||||
|
NM_SETTINGS_UPDATE2_FLAG_BLOCK_AUTOCONNECT,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
activate_update2_cb,
|
||||||
|
info);
|
||||||
|
} else {
|
||||||
|
nm_client_add_and_activate_connection_async (nmc->client,
|
||||||
|
connection,
|
||||||
|
info->device,
|
||||||
|
info->specific_object,
|
||||||
|
NULL,
|
||||||
|
add_and_activate_cb,
|
||||||
|
info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static NMCResultCode
|
static NMCResultCode
|
||||||
do_device_wifi_connect (NmCli *nmc, int argc, char **argv)
|
do_device_wifi_connect (NmCli *nmc, int argc, char **argv)
|
||||||
{
|
{
|
||||||
@@ -3144,11 +3176,9 @@ do_device_wifi_connect (NmCli *nmc, int argc, char **argv)
|
|||||||
NM80211ApFlags ap_flags;
|
NM80211ApFlags ap_flags;
|
||||||
NM80211ApSecurityFlags ap_wpa_flags;
|
NM80211ApSecurityFlags ap_wpa_flags;
|
||||||
NM80211ApSecurityFlags ap_rsn_flags;
|
NM80211ApSecurityFlags ap_rsn_flags;
|
||||||
NMRemoteConnection *remote_con = NULL;
|
gs_unref_object NMConnection *connection = NULL;
|
||||||
NMConnection *connection = NULL;
|
|
||||||
NMSettingConnection *s_con;
|
NMSettingConnection *s_con;
|
||||||
NMSettingWireless *s_wifi;
|
NMSettingWireless *s_wifi;
|
||||||
AddAndActivateInfo *info;
|
|
||||||
const char *param_user = NULL;
|
const char *param_user = NULL;
|
||||||
const char *ifname = NULL;
|
const char *ifname = NULL;
|
||||||
const char *bssid = NULL;
|
const char *bssid = NULL;
|
||||||
@@ -3399,7 +3429,7 @@ do_device_wifi_connect (NmCli *nmc, int argc, char **argv)
|
|||||||
|
|
||||||
avail_cons = nm_device_get_available_connections (device);
|
avail_cons = nm_device_get_available_connections (device);
|
||||||
for (i = 0; i < avail_cons->len; i++) {
|
for (i = 0; i < avail_cons->len; i++) {
|
||||||
NMRemoteConnection *avail_con = g_ptr_array_index (avail_cons, i);
|
NMConnection *avail_con = g_ptr_array_index (avail_cons, i);
|
||||||
const char *id = nm_connection_get_id (NM_CONNECTION (avail_con));
|
const char *id = nm_connection_get_id (NM_CONNECTION (avail_con));
|
||||||
|
|
||||||
if (con_name) {
|
if (con_name) {
|
||||||
@@ -3413,19 +3443,18 @@ do_device_wifi_connect (NmCli *nmc, int argc, char **argv)
|
|||||||
/* ap has been checked against bssid1, bssid2 and the ssid
|
/* ap has been checked against bssid1, bssid2 and the ssid
|
||||||
* and now avail_con has been checked against ap.
|
* and now avail_con has been checked against ap.
|
||||||
*/
|
*/
|
||||||
remote_con = avail_con;
|
connection = g_object_ref (avail_con);
|
||||||
connection = NM_CONNECTION (remote_con);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name_match && !remote_con) {
|
if (name_match && !connection) {
|
||||||
g_string_printf (nmc->return_text, _("Error: Connection '%s' exists but properties don't match."), con_name);
|
g_string_printf (nmc->return_text, _("Error: Connection '%s' exists but properties don't match."), con_name);
|
||||||
nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
|
nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!remote_con) {
|
if (!connection) {
|
||||||
/* If there are some connection data from user, create a connection and
|
/* If there are some connection data from user, create a connection and
|
||||||
* fill them into proper settings. */
|
* fill them into proper settings. */
|
||||||
if (con_name || private || bssid2_arr || hidden)
|
if (con_name || private || bssid2_arr || hidden)
|
||||||
@@ -3540,25 +3569,8 @@ do_device_wifi_connect (NmCli *nmc, int argc, char **argv)
|
|||||||
nmc->nowait_flag = (nmc->timeout == 0);
|
nmc->nowait_flag = (nmc->timeout == 0);
|
||||||
nmc->should_wait++;
|
nmc->should_wait++;
|
||||||
|
|
||||||
info = add_and_activate_info_new (nmc, device, FALSE, !remote_con, nm_object_get_path (NM_OBJECT (ap)));
|
save_and_activate_connection (nmc, device, connection, FALSE,
|
||||||
|
nm_object_get_path (NM_OBJECT (ap)));
|
||||||
if (remote_con) {
|
|
||||||
nm_remote_connection_update2 (remote_con,
|
|
||||||
nm_connection_to_dbus (connection, NM_CONNECTION_SERIALIZE_ALL),
|
|
||||||
NM_SETTINGS_UPDATE2_FLAG_BLOCK_AUTOCONNECT,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
activate_update2_cb,
|
|
||||||
info);
|
|
||||||
} else {
|
|
||||||
nm_client_add_and_activate_connection_async (nmc->client,
|
|
||||||
connection,
|
|
||||||
info->device,
|
|
||||||
info->specific_object,
|
|
||||||
NULL,
|
|
||||||
add_and_activate_cb,
|
|
||||||
info);
|
|
||||||
}
|
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
if (bssid1_arr)
|
if (bssid1_arr)
|
||||||
@@ -3572,19 +3584,17 @@ finish:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GBytes *
|
static GBytes *
|
||||||
generate_ssid_for_hotspot (const char *ssid)
|
generate_ssid_for_hotspot (void)
|
||||||
{
|
{
|
||||||
GBytes *ssid_bytes;
|
GBytes *ssid_bytes;
|
||||||
char *hotspot_ssid = NULL;
|
char *ssid = NULL;
|
||||||
|
|
||||||
if (!ssid) {
|
ssid = g_strdup_printf ("Hotspot-%s", g_get_host_name ());
|
||||||
hotspot_ssid = g_strdup_printf ("Hotspot-%s", g_get_host_name ());
|
if (strlen (ssid) > 32)
|
||||||
if (strlen (hotspot_ssid) > 32)
|
ssid[32] = '\0';
|
||||||
hotspot_ssid[32] = '\0';
|
|
||||||
ssid = hotspot_ssid;
|
|
||||||
}
|
|
||||||
ssid_bytes = g_bytes_new (ssid, strlen (ssid));
|
ssid_bytes = g_bytes_new (ssid, strlen (ssid));
|
||||||
g_free (hotspot_ssid);
|
g_free (ssid);
|
||||||
|
|
||||||
return ssid_bytes;
|
return ssid_bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3698,30 +3708,125 @@ set_wireless_security_for_hotspot (NMSettingWirelessSecurity *s_wsec,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static NMCResultCode
|
static NMConnection *
|
||||||
do_device_wifi_hotspot (NmCli *nmc, int argc, char **argv)
|
find_hotspot_conn (NMDevice *device,
|
||||||
|
const GPtrArray *connections,
|
||||||
|
const char *con_name,
|
||||||
|
GBytes *ssid_bytes,
|
||||||
|
const char *wifi_mode,
|
||||||
|
const char *band,
|
||||||
|
gint64 channel_int)
|
||||||
|
{
|
||||||
|
NMConnection *connection;
|
||||||
|
NMSettingWireless *s_wifi;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < connections->len; i++) {
|
||||||
|
connection = NM_CONNECTION (connections->pdata[i]);
|
||||||
|
|
||||||
|
s_wifi = nm_connection_get_setting_wireless (connection);
|
||||||
|
if (!s_wifi)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( channel_int != -1
|
||||||
|
&& nm_setting_wireless_get_channel (s_wifi) != channel_int)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (g_strcmp0 (nm_setting_wireless_get_mode (s_wifi), wifi_mode) != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (band && g_strcmp0 (nm_setting_wireless_get_band (s_wifi), band) != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (ssid_bytes && !g_bytes_equal (nm_setting_wireless_get_ssid (s_wifi), ssid_bytes))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!nm_device_connection_compatible (device, connection, NULL))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return g_object_ref (connection);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static NMConnection *
|
||||||
|
create_hotspot_conn (const GPtrArray *connections,
|
||||||
|
const char *con_name,
|
||||||
|
GBytes *ssid_bytes,
|
||||||
|
const char *wifi_mode,
|
||||||
|
const char *band,
|
||||||
|
gint64 channel_int)
|
||||||
{
|
{
|
||||||
AddAndActivateInfo *info;
|
|
||||||
const char *ifname = NULL;
|
|
||||||
const char *con_name = NULL;
|
|
||||||
char *default_name = NULL;
|
char *default_name = NULL;
|
||||||
const char *ssid = NULL;
|
NMConnection *connection;
|
||||||
const char *wifi_mode;
|
|
||||||
const char *band = NULL;
|
|
||||||
const char *channel = NULL;
|
|
||||||
unsigned long channel_int;
|
|
||||||
const char *password = NULL;
|
|
||||||
gboolean show_password = FALSE;
|
|
||||||
NMDevice *device = NULL;
|
|
||||||
gs_free NMDevice **devices = NULL;
|
|
||||||
NMDeviceWifiCapabilities caps;
|
|
||||||
NMConnection *connection = NULL;
|
|
||||||
NMSettingConnection *s_con;
|
NMSettingConnection *s_con;
|
||||||
NMSettingWireless *s_wifi;
|
NMSettingWireless *s_wifi;
|
||||||
NMSettingWirelessSecurity *s_wsec;
|
NMSettingWirelessSecurity *s_wsec;
|
||||||
NMSettingIPConfig *s_ip4, *s_ip6;
|
NMSettingIPConfig *s_ip4, *s_ip6;
|
||||||
NMSettingProxy *s_proxy;
|
NMSettingProxy *s_proxy;
|
||||||
GBytes *ssid_bytes;
|
|
||||||
|
connection = nm_simple_connection_new ();
|
||||||
|
s_con = (NMSettingConnection *) nm_setting_connection_new ();
|
||||||
|
nm_connection_add_setting (connection, NM_SETTING (s_con));
|
||||||
|
if (!con_name)
|
||||||
|
con_name = default_name = nmc_unique_connection_name (connections, "Hotspot");
|
||||||
|
g_object_set (s_con,
|
||||||
|
NM_SETTING_CONNECTION_ID, con_name,
|
||||||
|
NM_SETTING_CONNECTION_AUTOCONNECT, FALSE,
|
||||||
|
NULL);
|
||||||
|
g_free (default_name);
|
||||||
|
|
||||||
|
s_wifi = (NMSettingWireless *) nm_setting_wireless_new ();
|
||||||
|
nm_connection_add_setting (connection, NM_SETTING (s_wifi));
|
||||||
|
|
||||||
|
g_object_set (s_wifi, NM_SETTING_WIRELESS_MODE, wifi_mode,
|
||||||
|
NM_SETTING_WIRELESS_SSID, ssid_bytes,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
if (channel_int != -1) {
|
||||||
|
g_object_set (s_wifi,
|
||||||
|
NM_SETTING_WIRELESS_CHANNEL, (guint32) channel_int,
|
||||||
|
NM_SETTING_WIRELESS_BAND, band,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new ();
|
||||||
|
nm_connection_add_setting (connection, NM_SETTING (s_wsec));
|
||||||
|
|
||||||
|
s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
|
||||||
|
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
|
||||||
|
g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_SHARED, NULL);
|
||||||
|
|
||||||
|
s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
|
||||||
|
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
|
||||||
|
g_object_set (s_ip6, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL);
|
||||||
|
|
||||||
|
s_proxy = (NMSettingProxy *) nm_setting_proxy_new ();
|
||||||
|
nm_connection_add_setting (connection, NM_SETTING (s_proxy));
|
||||||
|
g_object_set (s_proxy, NM_SETTING_PROXY_METHOD, (int) NM_SETTING_PROXY_METHOD_NONE, NULL);
|
||||||
|
|
||||||
|
return connection;
|
||||||
|
}
|
||||||
|
|
||||||
|
static NMCResultCode
|
||||||
|
do_device_wifi_hotspot (NmCli *nmc, int argc, char **argv)
|
||||||
|
{
|
||||||
|
const char *ifname = NULL;
|
||||||
|
const char *con_name = NULL;
|
||||||
|
gs_unref_bytes GBytes *ssid_bytes = NULL;
|
||||||
|
const char *wifi_mode;
|
||||||
|
const char *band = NULL;
|
||||||
|
const char *channel = NULL;
|
||||||
|
gint64 channel_int = -1;
|
||||||
|
const char *password = NULL;
|
||||||
|
gboolean show_password = FALSE;
|
||||||
|
NMDevice *device = NULL;
|
||||||
|
gs_free NMDevice **devices = NULL;
|
||||||
|
NMDeviceWifiCapabilities caps;
|
||||||
|
gs_unref_object NMConnection *connection = NULL;
|
||||||
|
const GPtrArray *connections;
|
||||||
|
NMSettingWirelessSecurity *s_wsec;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
/* Set default timeout waiting for operation completion. */
|
/* Set default timeout waiting for operation completion. */
|
||||||
@@ -3762,11 +3867,11 @@ do_device_wifi_hotspot (NmCli *nmc, int argc, char **argv)
|
|||||||
g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
|
g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
|
||||||
return NMC_RESULT_ERROR_USER_INPUT;
|
return NMC_RESULT_ERROR_USER_INPUT;
|
||||||
}
|
}
|
||||||
ssid = *argv;
|
if (strlen (*argv) > 32) {
|
||||||
if (strlen (ssid) > 32) {
|
|
||||||
g_string_printf (nmc->return_text, _("Error: ssid is too long."));
|
g_string_printf (nmc->return_text, _("Error: ssid is too long."));
|
||||||
return NMC_RESULT_ERROR_USER_INPUT;
|
return NMC_RESULT_ERROR_USER_INPUT;
|
||||||
}
|
}
|
||||||
|
ssid_bytes = g_bytes_new (*argv, strlen (*argv));
|
||||||
} else if (strcmp (*argv, "band") == 0) {
|
} else if (strcmp (*argv, "band") == 0) {
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
@@ -3822,21 +3927,24 @@ do_device_wifi_hotspot (NmCli *nmc, int argc, char **argv)
|
|||||||
channel = "7";
|
channel = "7";
|
||||||
}
|
}
|
||||||
if (channel) {
|
if (channel) {
|
||||||
|
unsigned long int value;
|
||||||
|
|
||||||
if (!band) {
|
if (!band) {
|
||||||
g_string_printf (nmc->return_text, _("Error: channel requires band too."));
|
g_string_printf (nmc->return_text, _("Error: channel requires band too."));
|
||||||
return NMC_RESULT_ERROR_USER_INPUT;
|
return NMC_RESULT_ERROR_USER_INPUT;
|
||||||
}
|
}
|
||||||
if ( !nmc_string_to_uint (channel, TRUE, 1, 5825, &channel_int)
|
if ( !nmc_string_to_uint (channel, TRUE, 1, 5825, &value)
|
||||||
|| !nm_utils_wifi_is_channel_valid (channel_int, band)) {
|
|| !nm_utils_wifi_is_channel_valid (value, band)) {
|
||||||
g_string_printf (nmc->return_text, _("Error: channel '%s' not valid for band '%s'."),
|
g_string_printf (nmc->return_text, _("Error: channel '%s' not valid for band '%s'."),
|
||||||
channel, band);
|
channel, band);
|
||||||
return NMC_RESULT_ERROR_USER_INPUT;
|
return NMC_RESULT_ERROR_USER_INPUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
channel_int = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find Wi-Fi device. When no ifname is provided, the first Wi-Fi is used. */
|
/* Find Wi-Fi device. When no ifname is provided, the first Wi-Fi is used. */
|
||||||
device = find_wifi_device_by_iface (devices, ifname, NULL);
|
device = find_wifi_device_by_iface (devices, ifname, NULL);
|
||||||
|
|
||||||
if (!device) {
|
if (!device) {
|
||||||
if (ifname)
|
if (ifname)
|
||||||
g_string_printf (nmc->return_text, _("Error: Device '%s' is not a Wi-Fi device."), ifname);
|
g_string_printf (nmc->return_text, _("Error: Device '%s' is not a Wi-Fi device."), ifname);
|
||||||
@@ -3857,65 +3965,34 @@ do_device_wifi_hotspot (NmCli *nmc, int argc, char **argv)
|
|||||||
return NMC_RESULT_ERROR_UNKNOWN;
|
return NMC_RESULT_ERROR_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a connection with appropriate parameters */
|
connections = nm_client_get_connections (nmc->client);
|
||||||
connection = nm_simple_connection_new ();
|
connection = find_hotspot_conn (device, connections, con_name, ssid_bytes,
|
||||||
s_con = (NMSettingConnection *) nm_setting_connection_new ();
|
wifi_mode, band, channel_int);
|
||||||
nm_connection_add_setting (connection, NM_SETTING (s_con));
|
if (!connection) {
|
||||||
if (!con_name)
|
/* Create a connection with appropriate parameters */
|
||||||
con_name = default_name = nmc_unique_connection_name (nm_client_get_connections (nmc->client), "Hotspot");
|
if (!ssid_bytes)
|
||||||
g_object_set (s_con,
|
ssid_bytes = generate_ssid_for_hotspot ();
|
||||||
NM_SETTING_CONNECTION_ID, con_name,
|
connection = create_hotspot_conn (connections, con_name, ssid_bytes,
|
||||||
NM_SETTING_CONNECTION_AUTOCONNECT, FALSE,
|
wifi_mode, band, channel_int);
|
||||||
NULL);
|
|
||||||
g_free (default_name);
|
|
||||||
|
|
||||||
s_wifi = (NMSettingWireless *) nm_setting_wireless_new ();
|
|
||||||
nm_connection_add_setting (connection, NM_SETTING (s_wifi));
|
|
||||||
ssid_bytes = generate_ssid_for_hotspot (ssid);
|
|
||||||
g_object_set (s_wifi, NM_SETTING_WIRELESS_MODE, wifi_mode,
|
|
||||||
NM_SETTING_WIRELESS_SSID, ssid_bytes,
|
|
||||||
NULL);
|
|
||||||
g_bytes_unref (ssid_bytes);
|
|
||||||
if (channel)
|
|
||||||
g_object_set (s_wifi,
|
|
||||||
NM_SETTING_WIRELESS_CHANNEL, (guint32) channel_int,
|
|
||||||
NM_SETTING_WIRELESS_BAND, band,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new ();
|
|
||||||
nm_connection_add_setting (connection, NM_SETTING (s_wsec));
|
|
||||||
if (!set_wireless_security_for_hotspot (s_wsec, wifi_mode, caps, password, show_password, &error)) {
|
|
||||||
g_object_unref (connection);
|
|
||||||
g_string_printf (nmc->return_text, _("Error: Invalid 'password': %s."), error->message);
|
|
||||||
g_clear_error (&error);
|
|
||||||
return NMC_RESULT_ERROR_UNKNOWN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
|
if (password || !NM_IS_REMOTE_CONNECTION (connection)) {
|
||||||
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
|
s_wsec = nm_connection_get_setting_wireless_security (connection);
|
||||||
g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_SHARED, NULL);
|
g_return_val_if_fail (s_wsec, NMC_RESULT_ERROR_UNKNOWN);
|
||||||
|
|
||||||
s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new ();
|
if (!set_wireless_security_for_hotspot (s_wsec, wifi_mode, caps, password, show_password, &error)) {
|
||||||
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
|
g_object_unref (connection);
|
||||||
g_object_set (s_ip6, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL);
|
g_string_printf (nmc->return_text, _("Error: Invalid 'password': %s."), error->message);
|
||||||
|
g_clear_error (&error);
|
||||||
s_proxy = (NMSettingProxy *) nm_setting_proxy_new ();
|
return NMC_RESULT_ERROR_UNKNOWN;
|
||||||
nm_connection_add_setting (connection, NM_SETTING (s_proxy));
|
}
|
||||||
g_object_set (s_proxy, NM_SETTING_PROXY_METHOD, (int) NM_SETTING_PROXY_METHOD_NONE, NULL);
|
}
|
||||||
|
|
||||||
/* Activate the connection now */
|
/* Activate the connection now */
|
||||||
nmc->nowait_flag = (nmc->timeout == 0);
|
nmc->nowait_flag = (nmc->timeout == 0);
|
||||||
nmc->should_wait++;
|
nmc->should_wait++;
|
||||||
|
|
||||||
info = add_and_activate_info_new (nmc, device, TRUE, TRUE, NULL);
|
save_and_activate_connection (nmc, device, connection, TRUE, NULL);
|
||||||
|
|
||||||
nm_client_add_and_activate_connection_async (nmc->client,
|
|
||||||
connection,
|
|
||||||
device,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
add_and_activate_cb,
|
|
||||||
info);
|
|
||||||
|
|
||||||
return nmc->return_value;
|
return nmc->return_value;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user