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. [RFC] wifi: make max connection retries configurable
(Mans Rullgard)
2. Re: [PATCH v2 2/7] session: add allowed interface config
parameter (Lukasz Nowak)
----------------------------------------------------------------------
Message: 1
Date: Tue, 24 Jan 2017 13:28:27 +0000
From: Mans Rullgard <[email protected]>
To: [email protected]
Subject: [RFC] wifi: make max connection retries configurable
Message-ID: <[email protected]>
If when connecting to a wifi network, the authentication phase fails,
connman draws the conclusion that the wifi password was wrong. This is a
correct conclusion when wifi reception is good, but this can also occur
on marginal wifi reception.
This adds the setting FavoriteMaxRetries allowing the number of
connection attempts to be changed from the default of 2.
The effect can be observed by temporarily changing the psk of an access
point after the connection has been established, thus causing it to drop.
Restoring the original psk before the maximum retries have been reached
lets the connection be reestablished.
In a location with intermittent reception, allowing unlimited retries is
useful to avoid connman permanently disabling the network.
Signed-off-by: Mans Rullgard <[email protected]>
---
doc/connman.conf.5.in | 5 +++++
include/setting.h | 1 +
plugins/wifi.c | 4 ++--
src/main.c | 15 +++++++++++++++
4 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/doc/connman.conf.5.in b/doc/connman.conf.5.in
index 9b28aada468a..e4a8174964d2 100644
--- a/doc/connman.conf.5.in
+++ b/doc/connman.conf.5.in
@@ -145,5 +145,10 @@ ethernet tethering.
AllowHostnameUpdates = false
TetheringTechnologies = ethernet,wifi,bluetooth,gadget
.fi
+.TP
+.BI FavoriteMaxRetries=retries
+Maximum number of times to attempt connecting to a known wifi service in
+case of authentication failure. Set to negative to retry indefinitely.
+Default value is 2.
.SH "SEE ALSO"
.BR connman (8)
diff --git a/include/setting.h b/include/setting.h
index a88202176f5e..3cb06101394a 100644
--- a/include/setting.h
+++ b/include/setting.h
@@ -34,6 +34,7 @@ unsigned int *connman_setting_get_uint_list(const char *key);
unsigned int connman_timeout_input_request(void);
unsigned int connman_timeout_browser_launch(void);
+int connman_favorite_max_retries(void);
#ifdef __cplusplus
}
diff --git a/plugins/wifi.c b/plugins/wifi.c
index f8d88fa3ada0..558ccfbcb3cd 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -61,7 +61,6 @@
#define CLEANUP_TIMEOUT 8 /* in seconds */
#define INACTIVE_TIMEOUT 12 /* in seconds */
-#define FAVORITE_MAXIMUM_RETRIES 2
#define BGSCAN_DEFAULT "simple:30:-45:300"
#define AUTOSCAN_DEFAULT "exponential:3:300"
@@ -2357,7 +2356,8 @@ static bool
handle_4way_handshake_failure(GSupplicantInterface *interface,
wifi->retries++;
if (connman_service_get_favorite(service)) {
- if (wifi->retries < FAVORITE_MAXIMUM_RETRIES)
+ int max_retries = connman_favorite_max_retries();
+ if (max_retries < 0 || wifi->retries < max_retries)
return true;
}
diff --git a/src/main.c b/src/main.c
index 915c17ec43a5..e0cba99b36ef 100644
--- a/src/main.c
+++ b/src/main.c
@@ -78,6 +78,7 @@ static struct {
bool persistent_tethering_mode;
bool enable_6to4;
char *vendor_class_id;
+ int favorite_max_retries;
} connman_settings = {
.bg_scan = true,
.pref_timeservers = NULL,
@@ -94,6 +95,7 @@ static struct {
.persistent_tethering_mode = false,
.enable_6to4 = false,
.vendor_class_id = NULL,
+ .favorite_max_retries = 2,
};
#define CONF_BG_SCAN "BackgroundScanning"
@@ -111,6 +113,7 @@ static struct {
#define CONF_PERSISTENT_TETHERING_MODE "PersistentTetheringMode"
#define CONF_ENABLE_6TO4 "Enable6to4"
#define CONF_VENDOR_CLASS_ID "VendorClassID"
+#define CONF_FAVORITE_MAX_RETRIES "FavoriteMaxRetries"
static const char *supported_options[] = {
CONF_BG_SCAN,
@@ -128,6 +131,7 @@ static const char *supported_options[] = {
CONF_PERSISTENT_TETHERING_MODE,
CONF_ENABLE_6TO4,
CONF_VENDOR_CLASS_ID,
+ CONF_FAVORITE_MAX_RETRIES,
NULL
};
@@ -253,6 +257,7 @@ static void parse_config(GKeyFile *config)
char *vendor_class_id;
gsize len;
int timeout;
+ int retries;
if (!config) {
connman_settings.auto_connect =
@@ -393,6 +398,11 @@ static void parse_config(GKeyFile *config)
if (!error)
connman_settings.vendor_class_id = vendor_class_id;
+ retries = g_key_file_get_integer(config, "General",
+ CONF_FAVORITE_MAX_RETRIES, &error);
+ if (!error)
+ connman_settings.favorite_max_retries = retries;
+
g_clear_error(&error);
}
@@ -618,6 +628,11 @@ unsigned int connman_timeout_browser_launch(void)
return connman_settings.timeout_browserlaunch;
}
+int connman_favorite_max_retries(void)
+{
+ return connman_settings.favorite_max_retries;
+}
+
int main(int argc, char *argv[])
{
GOptionContext *context;
--
2.11.0
------------------------------
Message: 2
Date: Tue, 24 Jan 2017 15:38:36 +0000
From: Lukasz Nowak <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH v2 2/7] session: add allowed interface config
parameter
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252
Hi Daniel,
On 24/01/17 06:40, Daniel Wagner wrote:
> Good Morning Lukasz,
>
> On 01/23/2017 01:30 PM, Lukasz Nowak wrote:
>>> For AllowedBearer we have 'any' as match any available bearer. If
>>> the string is empty it means no bearer is allowed. I wonder if we
>>> should follow the AllowedBearer approach to keep it more
>>> consistent.
>>
>> I am not sure if this is the case. "any" is used for ConnectionType,
>> but there is no equivalent for AllowedBearers - user has to explicitly
>> provide an array of strings. There is no way to specify any/all as far
>> as I can see. For AllowedInterface, I chose an empty string, as an
>> interface can have an arbitrary name. So in theory you could have a real
>> interface named "any".
>
> You are right, I confused ConnectionType with AllowedBearers. AllowedBearers
> has the '*' for the meaning match any bearer type. Wouldn't '*' also work for
> AllowedInterface?
I can code that both empty string "" and "*" mean any interface. I don't think
that having an empty string meaning "none" has any value - it would effectively
disable a session.
I will also return "*" in the session update notifications over dbus (even if
an empty string was originally passed in):
Session Update = {
AllowedInterface = *
}
Is that ok?
>
> Thanks,
> Daniel
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 15, Issue 26
***************************************