[PATCH] README: Add remark to 'wpa_supplicant configuration' section
by jose@blanquicet.com
From: Jose Blanquicet <jose(a)blanquicet.com>
---
README | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/README b/README
index cff3131..cbd86a5 100644
--- a/README
+++ b/README
@@ -327,7 +327,10 @@ If wpa_supplicant is configured to D-Bus autostart, then ConnMan will
trigger the autostart of wpa_supplicant. However please keep in mind
that this trigger only happens once. If wpa_supplicant stops or crashes,
ConnMan does not periodically try to autostart it. It is up to systemd or
-similar service management tool to autostart it.
+similar service management tool to autostart it. In case wpa_supplicant
+is not started by ConnMan then make sure option "-u" is used in order
+to enable its D-Bus control interface and ensure ConnMan can communicate
+with it.
VPN
--
1.9.1
3 years, 5 months
[PATCH v2] dbus.h: Update include/dbus.h to remove unused macro
by Harish Jenny K N
CONNMAN_DEBUG_INTERFACE and CONNMAN_PROVIDER_INTERFACE
is not used anymore. Hence remove this from include/dbus.h
---
include/dbus.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/dbus.h b/include/dbus.h
index 26f94d6..bcab418 100644
--- a/include/dbus.h
+++ b/include/dbus.h
@@ -31,7 +31,6 @@ extern "C" {
#define CONNMAN_SERVICE "net.connman"
#define CONNMAN_PATH "/net/connman"
-#define CONNMAN_DEBUG_INTERFACE CONNMAN_SERVICE ".Debug"
#define CONNMAN_ERROR_INTERFACE CONNMAN_SERVICE ".Error"
#define CONNMAN_AGENT_INTERFACE CONNMAN_SERVICE ".Agent"
#define CONNMAN_COUNTER_INTERFACE CONNMAN_SERVICE ".Counter"
@@ -42,7 +41,6 @@ extern "C" {
#define CONNMAN_CLOCK_INTERFACE CONNMAN_SERVICE ".Clock"
#define CONNMAN_TASK_INTERFACE CONNMAN_SERVICE ".Task"
#define CONNMAN_SERVICE_INTERFACE CONNMAN_SERVICE ".Service"
-#define CONNMAN_PROVIDER_INTERFACE CONNMAN_SERVICE ".Provider"
#define CONNMAN_TECHNOLOGY_INTERFACE CONNMAN_SERVICE ".Technology"
#define CONNMAN_SESSION_INTERFACE CONNMAN_SERVICE ".Session"
#define CONNMAN_NOTIFICATION_INTERFACE CONNMAN_SERVICE ".Notification"
--
1.9.1
3 years, 5 months
[PATCH] man page: Add WPA-EAP identity verification options
by Angus Gratton
These were mentioned in doc/config-format.txt but not in the man page.
---
doc/connman-service.config.5.in | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/doc/connman-service.config.5.in b/doc/connman-service.config.5.in
index 535c626c..430c3394 100644
--- a/doc/connman-service.config.5.in
+++ b/doc/connman-service.config.5.in
@@ -96,6 +96,8 @@ configured, \fBpsk\fP if a passphrase is present and \fBnone\fP otherwise.
If set to \fBtrue\fP, then this AP is hidden. If missing or set to
\fBfalse\fP, then AP is not hidden.
.TP
+The following keys are used for WPA EAP (when \fBSecurity=ieee8021x\fP):
+.TP
.B EAP=tls \fR|\fB ttls \fR|\fB peap
EAP type to use. Only \fBtls\fP, \fBttls\fP and \fBpeap\fP are supported.
.TP
@@ -118,6 +120,22 @@ Identity string for EAP.
.BI AnonymousIdentity= identity
Anonymous identity string for EAP.
.TP
+.BI SubjectMatch= substring
+Substring to be matched against the subject of the
+authentication server certificate for EAP.
+.TP
+.BI AltSubjectMatch= substring
+Semicolon separated string of entries to be matched against the alternative
+subject name of the authentication server certificate for EAP.
+.TP
+.BI DomainSuffixMatch= domain
+Constraint for server domain name. If set, this FQDN is used as a suffix match
+requirement for the authentication server certificate for EAP.
+.TP
+.BI DomainMatch= domain
+This FQDN is used as a full match requirement for the
+authentication server certificate for EAP.
+.TP
.BI Phase2= type
Inner authentication type with for \fBEAP=tls\fP or \fBEAP=ttls\fP. Prefix
the value with \fBEAP-\fP to indicate usage of EAP-based authentication
--
2.13.3
3 years, 5 months
[PATCH 1/1] client: Add session Service config support
by sutar.mounesh@gmail.com
From: Bjoern Thorwirth <external.bjoern.thorwirth(a)de.bosch.com>
Added Service field in session config.
This allows processes to select a service context dependent
behaviour for which the routing decision is made.
diff --git a/client/commands.c b/client/commands.c
index 583095b..6c3e1f8 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -901,6 +901,13 @@ struct config_append {
int values;
};
+struct session_options {
+ char **args;
+ int num;
+ char *notify_path;
+ struct connman_option *options;
+};
+
static void config_append_ipv4(DBusMessageIter *iter,
void *user_data)
{
@@ -1796,28 +1803,141 @@ static int session_create_cb(DBusMessageIter *iter, const char *error,
return -EINPROGRESS;
}
+static void session_config_append_array(DBusMessageIter *iter,
+ void *user_data)
+{
+ struct config_append *append = user_data;
+ char **opts = append->opts;
+ int i = 1;
+
+ if (!opts)
+ return;
+
+ while (opts[i] && strncmp(opts[i], "--", 2) != 0) {
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
+ &opts[i]);
+ i++;
+ }
+
+ append->values = i;
+}
+
+static void session_create_append_dict(DBusMessageIter *iter, void *user_data)
+{
+ struct session_options *args_struct = user_data;
+ int index = 0, res = 0;
+ struct config_append append;
+ char c;
+ char *ifname;
+ dbus_bool_t source_ip_rule;
+
+ while (index < args_struct->num && args_struct->args[index]) {
+ append.opts = &args_struct->args[index];
+ append.values = 0;
+
+ c = parse_args(args_struct->args[index], args_struct->options);
+
+ switch (c) {
+ case 'b':
+ __connmanctl_dbus_append_dict_string_array(iter, "AllowedBearers",
+ session_config_append_array,
+ &append);
+ break;
+ case 't':
+ if (! args_struct->args[index + 1]) {
+ res = -EINVAL;
+ break;
+ }
+ __connmanctl_dbus_append_dict_entry(iter, "ConnectionType",
+ DBUS_TYPE_STRING,
+ &args_struct->args[index + 1]);
+ append.values = 2;
+ break;
+ case 'i':
+ if (index + 1 < args_struct->num)
+ ifname = args_struct->args[index + 1];
+ else
+ ifname = "";
+ __connmanctl_dbus_append_dict_entry(iter, "AllowedInterface",
+ DBUS_TYPE_STRING,
+ &ifname);
+ append.values = 2;
+ break;
+ case 's':
+ if (! args_struct->args[index + 1]) {
+ res = -EINVAL;
+ break;
+ }
+ switch (parse_boolean( args_struct->args[index + 1])) {
+ case 1:
+ source_ip_rule = TRUE;
+ break;
+ case 0:
+ source_ip_rule = FALSE;
+ break;
+ default:
+ res = -EINVAL;
+ break;
+ }
+ __connmanctl_dbus_append_dict_entry(iter, "SourceIPRule",
+ DBUS_TYPE_BOOLEAN,
+ &source_ip_rule);
+ append.values = 2;
+ break;
+ case 'S':
+ if (!args_struct->args[index + 1]) {
+ res = -EINVAL;
+ break;
+ }
+ __connmanctl_dbus_append_dict_entry(iter, "Service",
+ DBUS_TYPE_STRING,
+ &args_struct->args[index + 1]);
+ append.values = 2;
+ break;
+ default:
+ res = -EINVAL;
+ }
+
+ if (res < 0 && res != -EINPROGRESS) {
+ printf("Error '%s': %s\n", args_struct->args[index],
+ strerror(-res));
+ return;
+ }
+
+ index += append.values;
+ }
+
+ return;
+}
static void session_create_append(DBusMessageIter *iter, void *user_data)
{
- const char *notify_path = user_data;
+ struct session_options *args_struct = user_data;
- __connmanctl_dbus_append_dict(iter, NULL, NULL);
+ __connmanctl_dbus_append_dict(iter, session_create_append_dict,
+ args_struct);
dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH,
- ¬ify_path);
+ &args_struct->notify_path);
}
-static int session_create(gboolean connect)
+static int session_create(gboolean connect, char *args[], int num,
+ struct connman_option *options)
{
int res;
char *notify_path;
+ struct session_options args_struct;
+ args_struct.args = args;
+ args_struct.num = num;
+ args_struct.options = options;
notify_path = g_strdup_printf("/net/connman/connmanctl%d", getpid());
session_notify_add(notify_path);
+ args_struct.notify_path = notify_path;
res = __connmanctl_dbus_method_call(connection, "net.connman", "/",
"net.connman.Manager", "CreateSession",
session_create_cb, GINT_TO_POINTER(connect),
- session_create_append, notify_path);
+ session_create_append, &args_struct);
g_free(notify_path);
@@ -1871,25 +1991,6 @@ static int session_config_return(DBusMessageIter *iter, const char *error,
return 0;
}
-static void session_config_append_array(DBusMessageIter *iter,
- void *user_data)
-{
- struct config_append *append = user_data;
- char **opts = append->opts;
- int i = 1;
-
- if (!opts)
- return;
-
- while (opts[i] && strncmp(opts[i], "--", 2) != 0) {
- dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
- &opts[i]);
- i++;
- }
-
- append->values = i;
-}
-
static int session_config(char *args[], int num,
struct connman_option *options)
{
@@ -1959,7 +2060,18 @@ static int session_config(char *args[], int num,
DBUS_TYPE_BOOLEAN, &source_ip_rule);
append.values = 2;
break;
+ case 'S':
+ if (!args[index + 1]) {
+ res = -EINVAL;
+ break;
+ }
+ res = __connmanctl_dbus_session_change(connection,
+ session_path, session_config_return,
+ "Service", "Service",
+ DBUS_TYPE_STRING, &args[index + 1]);
+ append.values = 2;
+ break;
default:
res = -EINVAL;
}
@@ -1994,12 +2106,13 @@ static int cmd_session(char *args[], int num, struct connman_option *options)
case 1:
if (session_path)
return -EALREADY;
- return session_create(FALSE);
+ return session_create(FALSE, &args[2], num - 2, options);
default:
if (!strcmp(command, "connect")) {
if (!session_path)
- return session_create(TRUE);
+ return session_create(TRUE, &args[2], num - 2,
+ options);
return session_connect();
@@ -2248,6 +2361,7 @@ static struct connman_option session_options[] = {
{"type", 't', "local|internet|any"},
{"ifname", 'i', "[<interface_name>]"},
{"srciprule", 's', "yes|no"},
+ {"service", 'S', "service identifier"},
{ NULL, }
};
--
2.7.4
3 years, 5 months
☀omg! that's so exciting
by Cliff McDiarmid
Hey!
I've got something enjoyable for you, you'll definitely love it, take a look http://bonaelecta.cz/images/sampledata/parks/animals/fts/knock.php?dadb
Cliff McDiarmid
From: connman [mailto:connman@connman.net]
Sent: Friday, August 11, 2017 11:40 PM
To: cliffhanger(a)gardener.com
Subject: The biggest
Good point. My negativity about that post is really about being realistic because it only really tells half the story and in doing so, is simply sensationalistic writing that tugs at the heartstrings for living a carefree life.
The actual work that needs to go into creating a business that will sustain your life overseas is usually not covered in these types of blogs because it's not "sexy" or "adventurous" enough.
Some may argue that HOW they do it doesn't matter but the blog is all about inspiring others to do the same and to show others that the cost of adventure is surprisingly affordable. It's not hard to inspire people to go live on a beach. They just need the tools to create the system that will provide a sustainable nomadic life and THAT is what is missing from this article / blog.
Sent from Mail for Windows 10
3 years, 5 months
[PATCH] dbus.h: Update include/dbus.h to remove unused macro
by Harish Jenny K N
CONNMAN_DEBUG_INTERFACE is not used anymore. Hence remove
this from include/dbus.h
---
include/dbus.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/dbus.h b/include/dbus.h
index 26f94d6..d785d6d 100644
--- a/include/dbus.h
+++ b/include/dbus.h
@@ -31,7 +31,6 @@ extern "C" {
#define CONNMAN_SERVICE "net.connman"
#define CONNMAN_PATH "/net/connman"
-#define CONNMAN_DEBUG_INTERFACE CONNMAN_SERVICE ".Debug"
#define CONNMAN_ERROR_INTERFACE CONNMAN_SERVICE ".Error"
#define CONNMAN_AGENT_INTERFACE CONNMAN_SERVICE ".Agent"
#define CONNMAN_COUNTER_INTERFACE CONNMAN_SERVICE ".Counter"
--
1.9.1
3 years, 5 months
connmand[186]: Online check failed but running dhclient manually fixes this issue
by Eswaran Vinothkumar (BEG/PJ-IOT-EL)
Hello,
I am trying to use connman+ofono to connect to internet using TELIT 910 EUG modem chip.
Versions Used: Connman:1.34 and Ofono:1.20
To establish the internet connection I am using the python scripts within the ofono/test directory as follows:
/usr/lib/ofono/test/enable-modem
/usr/lib/ofono/test/online-modem
/usr/lib/ofono/test/set-roaming-allowed
/usr/lib/ofono/test/register-auto
/usr/lib/ofono/test/enable-gprs
/usr/lib/ofono/test/create-internet-context web.vodafone.de vodafone vodafone
/activate-context
/process-context-settings
After this I could see that the device gets the IP address, gateway and nameserver as shown below,
ofono_start_gsm.sh[192]: Interface is wwan0
ofono_start_gsm.sh[192]: IP address is 10.249.29.20
ofono_start_gsm.sh[192]: Gateway is 10.249.29.21
ofono_start_gsm.sh[192]: Nameserver is 10.105.144.254
At this point I excepted Connman to connect to the internet but it doesn't. I am seeing the following error message from Connman,
connmand[186]: Online check failed for 0x50db78 Vodafone.
>From the debug message I understood that connman is not able to connect to the internet(status 400).
But if I run manually dhclient on wwan0 interface, I could connect to the internet. It puzzles me, why it is not working with connman. Any help on this topic would be great :)
Mit freundlichen Grüßen / Best regards
Vinothkumar Eswaran
BEG-PT/PJ-EL
3 years, 5 months
[PATCH v2] dnsproxy: Fix crash on malformed DNS response
by Jukka Rissanen
If the response query string is malformed, we might access memory
pass the end of "name" variable in parse_response().
---
v2: changed the max_name type to size_t
src/dnsproxy.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index 38ac5bf..40b4f15 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -838,7 +838,7 @@ static struct cache_entry *cache_check(gpointer request, int *qtype, int proto)
static int get_name(int counter,
unsigned char *pkt, unsigned char *start, unsigned char *max,
unsigned char *output, int output_max, int *output_len,
- unsigned char **end, char *name, int *name_len)
+ unsigned char **end, char *name, size_t max_name, int *name_len)
{
unsigned char *p;
@@ -859,7 +859,7 @@ static int get_name(int counter,
return get_name(counter + 1, pkt, pkt + offset, max,
output, output_max, output_len, end,
- name, name_len);
+ name, max_name, name_len);
} else {
unsigned label_len = *p;
@@ -869,6 +869,9 @@ static int get_name(int counter,
if (*output_len > output_max)
return -ENOBUFS;
+ if ((*name_len + 1 + label_len + 1) > max_name)
+ return -ENOBUFS;
+
/*
* We need the original name in order to check
* if this answer is the correct one.
@@ -900,14 +903,14 @@ static int parse_rr(unsigned char *buf, unsigned char *start,
unsigned char *response, unsigned int *response_size,
uint16_t *type, uint16_t *class, int *ttl, int *rdlen,
unsigned char **end,
- char *name)
+ char *name, size_t max_name)
{
struct domain_rr *rr;
int err, offset;
int name_len = 0, output_len = 0, max_rsp = *response_size;
err = get_name(0, buf, start, max, response, max_rsp,
- &output_len, end, name, &name_len);
+ &output_len, end, name, max_name, &name_len);
if (err < 0)
return err;
@@ -1033,7 +1036,8 @@ static int parse_response(unsigned char *buf, int buflen,
memset(rsp, 0, sizeof(rsp));
ret = parse_rr(buf, ptr, buf + buflen, rsp, &rsp_len,
- type, class, ttl, &rdlen, &next, name);
+ type, class, ttl, &rdlen, &next, name,
+ sizeof(name) - 1);
if (ret != 0) {
err = ret;
goto out;
@@ -1099,7 +1103,7 @@ static int parse_response(unsigned char *buf, int buflen,
*/
ret = get_name(0, buf, next - rdlen, buf + buflen,
rsp, rsp_len, &output_len, &end,
- name, &name_len);
+ name, sizeof(name) - 1, &name_len);
if (ret != 0) {
/* just ignore the error at this point */
ptr = next;
--
2.9.4
3 years, 5 months
How to get IPv6 address ?
by Masashi Honma
I am trying to get IPv6 address with ConnMan.
But no IPv6 (include link local address) could not be obtained.
I could obtain IPv6 link local address and global addres with NetworkManager.
So this is not a issue of my network.
By my debugging, __connman_inet_ipv6_send_rs() calls ndisc_send_unspec() and
the the ndisc_send_unspec calls sendmsg(). Then sendmsg() returns EADDRNOTAVAIL.
Then dst=ff02::2 and src=::. By RFC 4861 "4.1. Router Solicitation Message
Format", source address == :: is allowed... For reference, I have captured
Router Solicitation of NetworkManager. dst is identical to ConnMan. src is
Link local IPv6 Address of the interface. I have captured the packets of ConnMan
also, but no router solicitaion packets was captured.
I will write my configurations.
boot arguments:
$ sudo src/connmand --wifi=nl80211 --nodaemon --debug --device=enp0s25 --config /home/honma/connman.conf
config file:
[General]
PreferredTechnologies=wifi,ethernet,cellular
SingleConnectedTechnology=false
AlwaysConnectedTechnologies=wifi,ethernet,cellular
Other configs by commands:
$ ./set-proxy <ethernet service> manual servers=URL:portno
$ ./set-ipv4-method <ethernet service> off
$ ./set-ipv6-method <ethernet service> auto
# I am using pacrunner built by source code.
ConnMan version:
---------------------
commit 4a47a848037ab5799473f22b22632e061d12fb69
Author: Daniel Wagner <wagi(a)monom.org>
Date: Mon Jul 24 14:50:34 2017 +0200
AUTHORS: Mention Guillaume's contribution
---------------------
kernel version:
Ubuntu 16.04 x64 (Linux 4.10.0-28-generic)
kernel config:
I have already enabled all the CONFIG_XXX in ConnMan README.
Is there any help ?
Masashi Honma.
3 years, 5 months
[PATCH] gsupplicant: Propagate only property changes of the connected BSS
by blanquicet@gmail.com
From: Jose Blanquicet <jose.blanquicet-melendez(a)magnetimarelli.com>
A ConnMan service is a WiFi network identified by the SSID, security (none, wep,
psk and ieee8021x) and mode (managed, adhoc, ap). This WiFi network could be
composed by multiple BSSs but it is shown as a single service by ConnMan. The
properties of that network correspond to the best BSS (Currently, only the
signal strength). The best BSS is the one with the highest signal strength. Now,
the issue is that ConnMan is selecting the best BSS by itself and it could cause
a misalignment with wpa_s; in particular when roaming. For instance, if ConnMan
updates the best BSS because there is a BSS with higher signal strength than the
current one but wpa_s takes too much time to roaming or even worse it never does
the roaming because such feature is not enabled in wpa_s; on both cases, ConnMan
will incorrectly start propagating the signal strength of the its best BSS but
actually we are associated to another one. Therefore, in these cases, the signal
strength the user will see for that network comes from the BSS with the highest
signal not from the one he are actually associated.
This patch makes ConnMan memorize the WiFi network it gets associated
(current_network). Then, from this point forward, the best BSS of that network
will only be updated if wpa_s signals a disassociation or we got associated with
another BSS (roaming).
With this patch, ConnMan is now able to distinguish at gsupplicant level which
is the BSS it is actually associated to because it will be always the best BSS
of the associated network. This is useful for future developments.
---
gsupplicant/supplicant.c | 118 ++++++++++++++++++++++++++++++++---------------
1 file changed, 81 insertions(+), 37 deletions(-)
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 2d5055769152..4f79012252e5 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -189,6 +189,7 @@ struct _GSupplicantInterface {
GHashTable *bss_mapping;
void *data;
const char *pending_peer_path;
+ GSupplicantNetwork *current_network;
struct added_network_information network_info;
};
@@ -1628,7 +1629,12 @@ done:
network->wps_capabilities |= bss->wps_capabilities;
}
- if (bss->signal > network->signal) {
+ /*
+ * Do not change best BSS if we are connected. It will be done through
+ * CurrentBSS property in case of misalignment with wpa_s or roaming.
+ */
+ if (network != interface->current_network &&
+ bss->signal > network->signal) {
network->signal = bss->signal;
network->best_bss = bss;
callback_network_changed(network, "Signal");
@@ -2088,6 +2094,75 @@ static void update_network_signal(GSupplicantNetwork *network)
SUPPLICANT_DBG("New network signal %d", network->signal);
}
+static void interface_current_bss(GSupplicantInterface *interface,
+ DBusMessageIter *iter)
+{
+ GSupplicantNetwork *network;
+ struct g_supplicant_bss *bss;
+ const char *path;
+
+ dbus_message_iter_get_basic(iter, &path);
+ if (g_strcmp0(path, "/") == 0) {
+ interface->current_network = NULL;
+ return;
+ }
+
+ interface_bss_added_without_keys(iter, interface);
+
+ network = g_hash_table_lookup(interface->bss_mapping, path);
+ if (!network)
+ return;
+
+ bss = g_hash_table_lookup(network->bss_table, path);
+ if (!bss)
+ return;
+
+ interface->current_network = network;
+
+ if (bss != network->best_bss) {
+ /*
+ * This is the case where either wpa_s got associated
+ * to a BSS different than the one ConnMan considers
+ * the best, or we are roaming.
+ */
+ SUPPLICANT_DBG("Update best BSS for %s", network->name);
+
+ network->best_bss = bss;
+
+ if (network->signal != bss->signal) {
+ SUPPLICANT_DBG("New network signal %d dBm",
+ bss->signal);
+
+ network->signal = bss->signal;
+ callback_network_changed(network, "Signal");
+ }
+ }
+
+ /*
+ * wpa_s could notify about CurrentBSS in any state once
+ * it got associated. It is not sure such notification will
+ * arrive together with transition to ASSOCIATED state.
+ * In fact, for networks with security WEP or OPEN, it
+ * always arrives together with transition to COMPLETED.
+ */
+ switch (interface->state) {
+ case G_SUPPLICANT_STATE_UNKNOWN:
+ case G_SUPPLICANT_STATE_DISABLED:
+ case G_SUPPLICANT_STATE_DISCONNECTED:
+ case G_SUPPLICANT_STATE_INACTIVE:
+ case G_SUPPLICANT_STATE_SCANNING:
+ case G_SUPPLICANT_STATE_AUTHENTICATING:
+ case G_SUPPLICANT_STATE_ASSOCIATING:
+ return;
+ case G_SUPPLICANT_STATE_ASSOCIATED:
+ case G_SUPPLICANT_STATE_4WAY_HANDSHAKE:
+ case G_SUPPLICANT_STATE_GROUP_HANDSHAKE:
+ case G_SUPPLICANT_STATE_COMPLETED:
+ callback_network_associated(network);
+ break;
+ }
+}
+
static void interface_bss_removed(DBusMessageIter *iter, void *user_data)
{
GSupplicantInterface *interface = user_data;
@@ -2270,42 +2345,7 @@ static void interface_property(const char *key, DBusMessageIter *iter,
g_strdup(interface->ifname), g_strdup(str));
}
} else if (g_strcmp0(key, "CurrentBSS") == 0) {
- GSupplicantNetwork *network;
- const char *path = NULL;
-
- dbus_message_iter_get_basic(iter, &path);
- if (g_strcmp0(path, "/") == 0)
- return;
-
- interface_bss_added_without_keys(iter, interface);
-
- network = g_hash_table_lookup(interface->bss_mapping, path);
- if (!network)
- return;
-
- /*
- * wpa_s could notify about CurrentBSS in any state once
- * it got associated. It is not sure such notification will
- * arrive together with transition to ASSOCIATED state.
- * In fact, for networks with security WEP or OPEN, it
- * always arrives together with transition to COMPLETED.
- */
- switch (interface->state) {
- case G_SUPPLICANT_STATE_UNKNOWN:
- case G_SUPPLICANT_STATE_DISABLED:
- case G_SUPPLICANT_STATE_DISCONNECTED:
- case G_SUPPLICANT_STATE_INACTIVE:
- case G_SUPPLICANT_STATE_SCANNING:
- case G_SUPPLICANT_STATE_AUTHENTICATING:
- case G_SUPPLICANT_STATE_ASSOCIATING:
- return;
- case G_SUPPLICANT_STATE_ASSOCIATED:
- case G_SUPPLICANT_STATE_4WAY_HANDSHAKE:
- case G_SUPPLICANT_STATE_GROUP_HANDSHAKE:
- case G_SUPPLICANT_STATE_COMPLETED:
- callback_network_associated(network);
- break;
- }
+ interface_current_bss(interface, iter);
} else if (g_strcmp0(key, "CurrentNetwork") == 0) {
interface_network_added(iter, interface);
} else if (g_strcmp0(key, "BSSs") == 0) {
@@ -2741,6 +2781,10 @@ static void signal_bss_changed(const char *path, DBusMessageIter *iter)
return;
}
+ /* Consider only property changes of the connected BSS */
+ if (network == interface->current_network && bss != network->best_bss)
+ return;
+
if (bss->signal == network->signal)
return;
--
1.9.1
3 years, 5 months