Re: [PATCH] wifi: allow autoconnect on AP/AdHoc mode connections with manual IP configuration

2016-02-12 Thread Thomas Haller
On Thu, 2016-02-11 at 14:39 -0600, Dan Williams wrote:
> On Thu, 2016-02-11 at 13:21 +0100, Thomas Haller wrote:
> > 
> > Patch lgtm, but it doesn't apply anywhere.
> 
> Sorry, patch was against 1.0.

I actually tried it on 1.0. But somehow I messed up, because now the
patch cleanly applies there...

Thomas

signature.asc
Description: This is a digitally signed message part
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [PATCH] wifi: allow autoconnect on AP/AdHoc mode connections with manual IP configuration

2016-02-11 Thread Thomas Haller
On Mon, 2016-02-08 at 17:03 -0600, Dan Williams wrote:
> The existing checks assumed that all AP/AdHoc connections would use
> the
> shared IP method.  But what we really want to check for here is
> whether the
> connection is AP/AdHoc.  Leave the existing 'shared' check for
> backwards
> compatibility.
> 
> Also move the check above the timestamp check, since the user
> shouldn't need
> to manually set a timestamp just to get an AP-mode connection to
> autoconnect.
> ---
>  src/devices/wifi/nm-device-wifi.c | 19 +--
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 


Patch lgtm, but it doesn't apply anywhere.


Thomas

signature.asc
Description: This is a digitally signed message part
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [PATCH] wifi: allow autoconnect on AP/AdHoc mode connections with manual IP configuration

2016-02-11 Thread Dan Williams
On Thu, 2016-02-11 at 13:21 +0100, Thomas Haller wrote:
> On Mon, 2016-02-08 at 17:03 -0600, Dan Williams wrote:
> > The existing checks assumed that all AP/AdHoc connections would use
> > the
> > shared IP method.  But what we really want to check for here is
> > whether the
> > connection is AP/AdHoc.  Leave the existing 'shared' check for
> > backwards
> > compatibility.
> > 
> > Also move the check above the timestamp check, since the user
> > shouldn't need
> > to manually set a timestamp just to get an AP-mode connection to
> > autoconnect.
> > ---
> >  src/devices/wifi/nm-device-wifi.c | 19 +--
> >  1 file changed, 13 insertions(+), 6 deletions(-)
> > 
> 
> 
> Patch lgtm, but it doesn't apply anywhere.

Sorry, patch was against 1.0.  I've fixed it up for master and pushed
to 1.0 and master.

Dan
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] wifi: allow autoconnect on AP/AdHoc mode connections with manual IP configuration

2016-02-08 Thread Dan Williams
The existing checks assumed that all AP/AdHoc connections would use the
shared IP method.  But what we really want to check for here is whether the
connection is AP/AdHoc.  Leave the existing 'shared' check for backwards
compatibility.

Also move the check above the timestamp check, since the user shouldn't need
to manually set a timestamp just to get an AP-mode connection to autoconnect.
---
 src/devices/wifi/nm-device-wifi.c | 19 +--
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/devices/wifi/nm-device-wifi.c 
b/src/devices/wifi/nm-device-wifi.c
index 8ea3b68..4198a8a 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -1140,13 +1140,25 @@ can_auto_connect (NMDevice *device,
 {
NMDeviceWifi *self = NM_DEVICE_WIFI (device);
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
+   NMSettingWireless *s_wifi;
GSList *ap_iter;
-   const char *method = NULL;
+   const char *method, *mode;
guint64 timestamp = 0;
 
if (!NM_DEVICE_CLASS (nm_device_wifi_parent_class)->can_auto_connect 
(device, connection, specific_object))
return FALSE;
 
+   s_wifi = nm_connection_get_setting_wireless (connection);
+   g_return_val_if_fail (s_wifi, FALSE);
+
+   /* Always allow autoconnect for shared/Ad-Hoc/AP */
+   method = nm_utils_get_ip_config_method (connection, 
NM_TYPE_SETTING_IP4_CONFIG);
+   mode = nm_setting_wireless_get_mode (s_wifi);
+   if (   g_strcmp0 (mode, NM_SETTING_WIRELESS_MODE_ADHOC) == 0
+   || g_strcmp0 (mode, NM_SETTING_WIRELESS_MODE_AP) == 0
+   || g_strcmp0 (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED) == 0)
+   return TRUE;
+
/* Don't autoconnect to networks that have been tried at least once
 * but haven't been successful, since these are often accidental choices
 * from the menu and the user may not know the password.
@@ -1156,11 +1168,6 @@ can_auto_connect (NMDevice *device,
return FALSE;
}
 
-   /* Use the connection if it's a shared connection */
-   method = nm_utils_get_ip_config_method (connection, 
NM_TYPE_SETTING_IP4_CONFIG);
-   if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED))
-   return TRUE;
-
for (ap_iter = priv->ap_list; ap_iter; ap_iter = g_slist_next 
(ap_iter)) {
NMAccessPoint *ap = NM_AP (ap_iter->data);
 
-- 
2.4.3
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list