Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. [PATCH] Supporting wifi load balancing and band steering
      ([email protected])
   2. [PATCH] gsupplicant: Optimize AddNetwork Handler by avoiding
      DBUS call. ([email protected])
   3. [PATCH] plugins/wifi: Do not disable network on Disconnect
      ([email protected])
   4. Re: [PATCH 1/2] ntp: Add option TimeUpdateThreshold (Patrik Flykt)
   5. Re: [PATCH 0/2] Extend NTP for exotic use cases (Patrik Flykt)
   6. Re: [PATCH 0/2] Extend NTP for exotic use cases ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Mon,  7 Mar 2016 16:47:18 -0800
From: [email protected]
To: [email protected]
Cc: Naveen Singh <[email protected]>
Subject: [PATCH] Supporting wifi load balancing and band steering
Message-ID: <[email protected]>

From: Naveen Singh <[email protected]>

Enterprise APS sometimes refuse association with assoc response
status code 17. AP basically wants to steer client to a right
band or a better AP for load balancing purposes. This does not
use to work as connman has no way to know that association was
denied and it would treat this disconnect notification as a normal
disconnect. wpa supplicant was sending DisconnectReason on DBUS as
a part of PropertyChanged signal but there was no AssocStatusCode.
In this commit id of hostapd (c7fb678f3109e62af1ef39be9b12bf8370c35bde)
wpa supplicant is also sending assoc status code as a part of
PropertyChanged DBUS signal. Idea is that on a disconnect notification
from wpa supplicant, if the prior interface state is associating
(means a conection is underway) and association was denied with status
code 17 then do not proceed. This would let wpa_supplicant chose another
BSSID where association would stick.

This is been tested by running a stress test which tries connection with
an enterprise AP which frequently denies association with status code 17.
---
 gsupplicant/gsupplicant.h |  2 ++
 gsupplicant/supplicant.c  | 19 ++++++++++++++++++-
 plugins/wifi.c            | 45 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 65 insertions(+), 1 deletion(-)

diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index a2a7605..2f9806e 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -353,6 +353,8 @@ struct _GSupplicantCallbacks {
                                        GSupplicantPeerState state);
        void (*peer_request) (GSupplicantPeer *peer);
        void (*debug) (const char *str);
+       void (*update_disconnect_reasoncode)(GSupplicantInterface *interface, 
int reasoncode);
+       void (*update_assoc_status_code)(GSupplicantInterface *interface, int 
reasoncode);
 };
 
 typedef struct _GSupplicantCallbacks GSupplicantCallbacks;
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index c8fbef6..a5195b1 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -2135,9 +2135,26 @@ static void interface_property(const char *key, 
DBusMessageIter *iter,
        } else if (g_strcmp0(key, "Networks") == 0) {
                supplicant_dbus_array_foreach(iter, interface_network_added,
                                                                interface);
-       } else
+       } else if (g_strcmp0(key, "DisconnectReason") == 0) {
+               int reason;
+               if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_INVALID) {
+                       dbus_message_iter_get_basic(iter, &reason);
+                       if (callbacks_pointer && 
callbacks_pointer->update_disconnect_reasoncode && reason != 0) {
+                               
callbacks_pointer->update_disconnect_reasoncode(interface, reason);
+                       }
+               }
+       } else if (g_strcmp0(key, "AssocStatusCode") == 0) {
+               int status_code;
+               if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_INVALID) {
+                       dbus_message_iter_get_basic(iter, &status_code);
+                       if (callbacks_pointer && 
callbacks_pointer->update_assoc_status_code) {
+                               
callbacks_pointer->update_assoc_status_code(interface, status_code);
+                       }
+               }
+       } else {
                SUPPLICANT_DBG("key %s type %c",
                                key, dbus_message_iter_get_arg_type(iter));
+       }
 }
 
 static void scan_network_update(DBusMessageIter *iter, void *user_data)
diff --git a/plugins/wifi.c b/plugins/wifi.c
index bb1cabc..6219b81 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -71,6 +71,8 @@
 #define P2P_LISTEN_PERIOD 500
 #define P2P_LISTEN_INTERVAL 2000
 
+#define GSUP_80211_ASSOC_STATUS_NO_ADDITIONAL_CLIENT 17
+#define WPA_SUP_LOAD_SHAPING_MAX_RETRIES 3
 static struct connman_technology *wifi_technology = NULL;
 static struct connman_technology *p2p_technology = NULL;
 
@@ -128,6 +130,7 @@ struct wifi_data {
        unsigned flags;
        unsigned int watch;
        int retries;
+       int wpa_sup_load_shaping_retries;
        struct hidden_params *hidden;
        bool postpone_hidden;
        struct wifi_tethering_info *tethering_param;
@@ -144,6 +147,8 @@ struct wifi_data {
        bool p2p_connecting;
        bool p2p_device;
        int servicing;
+       int disconnect_reasoncode;
+       int assoc_statuscode;
 };
 
 static GList *iface_list = NULL;
@@ -2291,6 +2296,19 @@ static bool handle_wps_completion(GSupplicantInterface 
*interface,
        return true;
 }
 
+static bool handle_assoc_status_code(GSupplicantInterface *interface,
+                                     struct wifi_data *wifi)
+{
+       if (wifi->state == G_SUPPLICANT_STATE_ASSOCIATING &&
+               wifi->assoc_statuscode == 
GSUP_80211_ASSOC_STATUS_NO_ADDITIONAL_CLIENT &&
+               wifi->wpa_sup_load_shaping_retries < 
WPA_SUP_LOAD_SHAPING_MAX_RETRIES) {
+               wifi->wpa_sup_load_shaping_retries ++;
+               return TRUE;
+       }
+       wifi->wpa_sup_load_shaping_retries = 0;
+       return FALSE;
+}
+
 static bool handle_4way_handshake_failure(GSupplicantInterface *interface,
                                        struct connman_network *network,
                                        struct wifi_data *wifi)
@@ -2382,6 +2400,10 @@ static void interface_state(GSupplicantInterface 
*interface)
                        break;
 
                connman_network_set_connected(network, true);
+
+               wifi->disconnect_reasoncode = 0;
+               wifi->assoc_statuscode = 0;
+               wifi->wpa_sup_load_shaping_retries = 0;
                break;
 
        case G_SUPPLICANT_STATE_DISCONNECTED:
@@ -2399,6 +2421,9 @@ static void interface_state(GSupplicantInterface 
*interface)
                if (is_idle(wifi))
                        break;
 
+               if (handle_assoc_status_code(interface, wifi))
+                       break;
+
                /* If previous state was 4way-handshake, then
                 * it's either: psk was incorrect and thus we retry
                 * or if we reach the maximum retries we declare the
@@ -2935,6 +2960,24 @@ static void debug(const char *str)
                connman_debug("%s", str);
 }
 
+static void wifi_disconnect_reasoncode(GSupplicantInterface *interface, int 
reasoncode)
+{
+       struct wifi_data *wifi = g_supplicant_interface_get_data(interface);
+
+       if (wifi != NULL) {
+               wifi->disconnect_reasoncode = reasoncode;
+       }
+}
+
+static void wifi_assoc_status_code(GSupplicantInterface *interface, int 
status_code)
+{
+       struct wifi_data *wifi = g_supplicant_interface_get_data(interface);
+
+       if (wifi != NULL) {
+               wifi->assoc_statuscode = status_code;
+       }
+}
+
 static const GSupplicantCallbacks callbacks = {
        .system_ready           = system_ready,
        .system_killed          = system_killed,
@@ -2953,6 +2996,8 @@ static const GSupplicantCallbacks callbacks = {
        .peer_changed           = peer_changed,
        .peer_request           = peer_request,
        .debug                  = debug,
+       .update_disconnect_reasoncode = wifi_disconnect_reasoncode,
+       .update_assoc_status_code = wifi_assoc_status_code,
 };
 
 
-- 
2.7.0.rc3.207.g0ac5344



------------------------------

Message: 2
Date: Mon,  7 Mar 2016 17:55:39 -0800
From: [email protected]
To: [email protected]
Cc: Naveen Singh <[email protected]>
Subject: [PATCH] gsupplicant: Optimize AddNetwork Handler by avoiding
        DBUS call.
Message-ID: <[email protected]>

From: Naveen Singh <[email protected]>

In case network path is not NULL, network should only be removed
if the new network (to be added) is different from what is sitting
in wpa_supplicant. This would avoid two DBUS calls: AddNetwork and
SelectNetwork.
---
 gsupplicant/supplicant.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index c8fbef6..b4920fc 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -181,6 +181,7 @@ struct _GSupplicantInterface {
        GHashTable *bss_mapping;
        void *data;
        const char *pending_peer_path;
+       char * added_ssid;
 };
 
 struct g_supplicant_bss {
@@ -4111,6 +4112,9 @@ static void interface_add_network_result(const char 
*error,
 
        interface->network_path = g_strdup(path);
 
+       g_free(interface->added_ssid);
+       interface->added_ssid = g_strdup(data->ssid->ssid);
+
        supplicant_dbus_method_call(data->interface->path,
                        SUPPLICANT_INTERFACE ".Interface", "SelectNetwork",
                        interface_select_network_params,
@@ -4708,6 +4712,17 @@ int g_supplicant_interface_connect(GSupplicantInterface 
*interface,
                        g_free(data->path);
                        dbus_free(data);
 
+                       /* If this add network is for the same SSID for which
+                        * wpa_supplicant already has a profile then do not need
+                        * to add another profile. Only if the profile that 
needs
+                        * to get added is different from what is there in wpa_s
+                        * delete the current one. interface->added_ssid is 
populated
+                        * once add network request is successful.*/
+
+                       if (g_strcmp0(interface->added_ssid, ssid->ssid) == 0) {
+                               return -EALREADY;
+                       }
+
                        intf_data = dbus_malloc0(sizeof(*intf_data));
                        if (!intf_data)
                                return -ENOMEM;
-- 
2.7.0.rc3.207.g0ac5344



------------------------------

Message: 3
Date: Mon,  7 Mar 2016 18:44:00 -0800
From: [email protected]
To: [email protected]
Cc: Naveen Singh <[email protected]>
Subject: [PATCH] plugins/wifi: Do not disable network on Disconnect
Message-ID: <[email protected]>

From: Naveen Singh <[email protected]>

Connman currently disables network on a disconnect event. This severely
impacts wpa supplicant ability to roam to same or different BSSID. The
act of disabling network disables the complete network profile in wpa
supplicant and it does not try to connect on its own and then waits for
a new connection attempt from connman. This delays the re-connection
timings. Once a network is disabled, wpa supplicant will generate a
locally generated deauth while a connection is going through.
wpa_supplicant is currently has the best knowledge of getting back L2 level
connectivity.With this change this is how it would appear in log lines
when a deauth with reason code 7/6/4 is received:
1. wpa_supplicant gets the reason code 7 deauth
2. wpa_supplicant starts a fast connect attempt
3. wpa_supplicant generates a disconnect notification to connman
4. connman calls set_disconnected which would make device lose its
current IP address.
5. service is disconnected as well.
6. wpa_supplicant gets device connected back to same AP in this case
7. wpa_supplicant generates connected event.
8. connman starts with DHCP request (having same IP as the previous
one).
---
 plugins/wifi.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index bb1cabc..382ed81 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2407,12 +2407,6 @@ static void interface_state(GSupplicantInterface 
*interface)
                                                network, wifi))
                        break;
 
-               /* We disable the selected network, if not then
-                * wpa_supplicant will loop retrying */
-               if (g_supplicant_interface_enable_selected_network(interface,
-                                               FALSE) != 0)
-                       DBG("Could not disable selected network");
-
                connman_network_set_connected(network, false);
                connman_network_set_associating(network, false);
                wifi->disconnecting = false;
-- 
2.7.0.rc3.207.g0ac5344



------------------------------

Message: 4
Date: Tue, 08 Mar 2016 09:07:33 +0200
From: Patrik Flykt <[email protected]>
To: Zolt?n B?sz?rm?nyi <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 1/2] ntp: Add option TimeUpdateThreshold
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"

On Mon, 2016-03-07 at 18:13 +0100, Zolt?n B?sz?rm?nyi wrote:
> Add option TimeUpdateThreshold (type: double units: seconds)
> to make the threshold for using settimeofday() vs adjtime()
> configurable. The RTC in some machines is so bad that with the
> current hardcoded 0.128 seconds, connman occasionally decides
> to use settimeofday() instead of adjtime().

I don't think such a short interval was the intention here. I myself was
in the belief that it was 2 seconds. Need to have a look at related
patches to see if it has broken at some point.

I'm not a very big fan of adding more configuration variables if finding
a reasonable value fixes the case.

Cheers,

        Patrik



------------------------------

Message: 5
Date: Tue, 08 Mar 2016 09:09:13 +0200
From: Patrik Flykt <[email protected]>
To: Zolt?n B?sz?rm?nyi <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 0/2] Extend NTP for exotic use cases
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"

On Mon, 2016-03-07 at 18:13 +0100, Zolt?n B?sz?rm?nyi wrote:
> 2. The appliances we ship use our own company NTP server but are
> placed
>    on clients' site where the DHCP server is not under our control and
>    do not trust the clients' NTP server. Because of this, another knob
>    is added to disable adding NTP servers from DHCP info. Also, this
>    knob also controls adding the network gateway as an NTP server,
>    which is identical to the DHCP server in some cases.

Hmm. Why can't you just set Timeservers.Configuration for the service in
question? Or, if it is provisioned, Timeservers in the .config file?

Cheers,

        Patrik



------------------------------

Message: 6
Date: Tue, 08 Mar 2016 09:59:49 +0100
From: [email protected]
To: [email protected]
Subject: Re: [PATCH 0/2] Extend NTP for exotic use cases
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

 

Hi, 

> Hmm. Why can't you just set Timeservers.Configuration for the service in
> question? Or, if it is provisioned, Timeservers in the .config file?

Timeservers = ... is set in wired.config and despite that, the DHCP
server
address (which is also the gateway) still occurs in the list of
timeservers.

Apparently, this occurs because the network gateway address is added
unconditionally to the list of timeservers.

This patch would solve this part:

diff --git a/src/timeserver.c b/src/timeserver.c
index f0d33e5..72e6ea9 100644
--- a/src/timeserver.c
+++ b/src/timeserver.c
@@ -204,17 +204,6 @@ GSList *__connman_timeserver_get_all(struct
connman_service *service)
 for (i = 0; service_ts && service_ts[i]; i++)
 list = __connman_timeserver_add_list(list, service_ts[i]);

- network = __connman_service_get_network(service);
- if (network) {
- index = connman_network_get_index(network);
- service_gw = __connman_ipconfig_get_gateway_from_index(index,
- CONNMAN_IPCONFIG_TYPE_ALL);
-
- /* Then add Service Gateway to the list */
- if (service_gw)
- list = __connman_timeserver_add_list(list, service_gw);
- }
-
 /* Then add Global Timeservers to the list */
 timeservers = load_timeservers();

Why is this done in the first place?

Best regards,
Zolt?n B?sz?rm?nyi

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.01.org/pipermail/connman/attachments/20160308/c5c3c48e/attachment.html>

------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 5, Issue 8
*************************************

Reply via email to