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. Re: Getting of ethernet MAC (Vladimir Davydov)
2. Re: Getting of ethernet MAC (Patrik Flykt)
3. [PATCH] build: Remember to clean generated VPN D-Bus file
(Patrik Flykt)
4. [PATCH v3] service: Update nameservers and timeservers with
address change (Patrik Flykt)
5. [PATCH 0/2] State check clean up (Patrik Flykt)
6. [PATCH 1/2] service: Remove additional network state check
(Patrik Flykt)
7. [PATCH 2/2] service: Clean up service state check functions
(Patrik Flykt)
----------------------------------------------------------------------
Message: 1
Date: Wed, 11 Jan 2017 13:00:03 +0300
From: Vladimir Davydov <[email protected]>
To: Patrik Flykt <[email protected]>
Cc: <[email protected]>
Subject: Re: Getting of ethernet MAC
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
Hello Patrik,
Thank you for the answer.
So, let me ask again,
If connman is started with cable unplugged, then we don't have any way to get
ethernet MAC from connman.
Is it correct?
Thanks,
Vladimir
> On Tue, 2017-01-10 at 20:20 +0300, Vladimir Davydov wrote:
> > How to get MAC address of ethernet device if network cable is NOT
> > plugged?
>
> The MAC address is/was only available via the service that got removed
> when the cable was unplugged.
>
> Cheers,
>
> Patrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.01.org/pipermail/connman/attachments/20170111/95197b34/attachment-0001.html>
------------------------------
Message: 2
Date: Wed, 11 Jan 2017 12:02:45 +0200
From: Patrik Flykt <[email protected]>
To: Vladimir Davydov <[email protected]>
Cc: [email protected]
Subject: Re: Getting of ethernet MAC
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"
On Wed, 2017-01-11 at 13:00 +0300, Vladimir Davydov wrote:
> If connman is started with cable unplugged, then we don't have any
> way to get ethernet MAC from connman.
> ?
> Is it correct?
Yes.
Patrik
------------------------------
Message: 3
Date: Wed, 11 Jan 2017 12:06:19 +0200
From: Patrik Flykt <[email protected]>
To: [email protected]
Subject: [PATCH] build: Remember to clean generated VPN D-Bus file
Message-ID: <[email protected]>
---
Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile.am b/Makefile.am
index 96a305d0..e67a7a55 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -479,6 +479,7 @@ if POLKIT
else
$(AM_V_GEN)cp $(srcdir)/vpn/vpn-dbus.conf $@
endif
+CLEANFILES += vpn/connman-vpn-dbus.conf
endif
if SELINUX
--
2.11.0
------------------------------
Message: 4
Date: Wed, 11 Jan 2017 12:06:36 +0200
From: Patrik Flykt <[email protected]>
To: [email protected]
Subject: [PATCH v3] service: Update nameservers and timeservers with
address change
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8
When the IP address changes, nameservers need to be removed and
re-added in order for them to pick up the changed IP address. The
same applies to timeservers, restart the query for those as well.
Reported by M?ns Rullg?rd.
---
src/service.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/service.c b/src/service.c
index 2a714763..d78e0d0e 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1389,6 +1389,18 @@ void __connman_service_nameserver_del_routes(struct
connman_service *service,
nameserver_del_routes(index, service->nameservers, type);
}
+static void address_updated(struct connman_service *service,
+ enum connman_ipconfig_type type)
+{
+ if (is_connected_state(service, service->state) &&
+ service == __connman_service_get_default()) {
+ nameserver_remove_all(service, type);
+ nameserver_add_all(service, type);
+
+ __connman_timeserver_sync(service);
+ }
+}
+
static struct connman_stats *stats_get(struct connman_service *service)
{
if (service->roaming)
@@ -3316,6 +3328,7 @@ int __connman_service_reset_ipconfig(struct
connman_service *service,
*new_state = service->state_ipv6;
settings_changed(service, new_ipconfig);
+ address_updated(service, new_method);
__connman_service_auto_connect(CONNMAN_SERVICE_CONNECT_REASON_AUTO);
}
@@ -6587,6 +6600,7 @@ static void service_ip_bound(struct connman_ipconfig
*ipconfig,
CONNMAN_IPCONFIG_TYPE_IPV6);
settings_changed(service, ipconfig);
+ address_updated(service, type);
}
static void service_ip_release(struct connman_ipconfig *ipconfig,
--
2.11.0
------------------------------
Message: 5
Date: Wed, 11 Jan 2017 12:43:39 +0200
From: Patrik Flykt <[email protected]>
To: [email protected]
Subject: [PATCH 0/2] State check clean up
Message-ID: <[email protected]>
Hi,
Here are two (long overdue) patches cleaning up state checking in
service.c.
The second patch applies on top of '[PATCH v3] service: Update nameservers
and timeservers with address change'.
Patrik
Patrik Flykt (2):
service: Remove additional network state check
service: Clean up service state check functions
src/service.c | 124 ++++++++++++++++++++++++----------------------------------
1 file changed, 51 insertions(+), 73 deletions(-)
--
2.11.0
------------------------------
Message: 6
Date: Wed, 11 Jan 2017 12:43:40 +0200
From: Patrik Flykt <[email protected]>
To: [email protected]
Subject: [PATCH 1/2] service: Remove additional network state check
Message-ID: <[email protected]>
Network state indication is tracked with
__connman_service_ipconfig_indicate_state().
---
src/service.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/service.c b/src/service.c
index d78e0d0e..fd32175b 100644
--- a/src/service.c
+++ b/src/service.c
@@ -897,8 +897,6 @@ static bool is_connecting_state(struct connman_service
*service,
case CONNMAN_SERVICE_STATE_UNKNOWN:
case CONNMAN_SERVICE_STATE_IDLE:
case CONNMAN_SERVICE_STATE_FAILURE:
- if (service->network)
- return connman_network_get_connecting(service->network);
case CONNMAN_SERVICE_STATE_DISCONNECT:
case CONNMAN_SERVICE_STATE_READY:
case CONNMAN_SERVICE_STATE_ONLINE:
--
2.11.0
------------------------------
Message: 7
Date: Wed, 11 Jan 2017 12:43:41 +0200
From: Patrik Flykt <[email protected]>
To: [email protected]
Subject: [PATCH 2/2] service: Clean up service state check functions
Message-ID: <[email protected]>
None of the state cheking functions need a service struct, clean up
the state check functions to take only state as argument.
---
I think I also fixed a bug in __connman_service_is_connected_state(),
don't know why the compiler hasn't so far reacted.
src/service.c | 122 ++++++++++++++++++++++++----------------------------------
1 file changed, 51 insertions(+), 71 deletions(-)
diff --git a/src/service.c b/src/service.c
index fd32175b..1ce8b8af 100644
--- a/src/service.c
+++ b/src/service.c
@@ -890,8 +890,7 @@ done:
return result;
}
-static bool is_connecting_state(struct connman_service *service,
- enum connman_service_state state)
+static bool is_connecting(enum connman_service_state state)
{
switch (state) {
case CONNMAN_SERVICE_STATE_UNKNOWN:
@@ -909,8 +908,7 @@ static bool is_connecting_state(struct connman_service
*service,
return false;
}
-static bool is_connected_state(const struct connman_service *service,
- enum connman_service_state state)
+static bool is_connected(enum connman_service_state state)
{
switch (state) {
case CONNMAN_SERVICE_STATE_UNKNOWN:
@@ -928,9 +926,9 @@ static bool is_connected_state(const struct connman_service
*service,
return false;
}
-static bool is_idle(struct connman_service *service)
+static bool is_idle(enum connman_service_state state)
{
- switch (service->state) {
+ switch (state) {
case CONNMAN_SERVICE_STATE_IDLE:
case CONNMAN_SERVICE_STATE_DISCONNECT:
case CONNMAN_SERVICE_STATE_FAILURE:
@@ -946,17 +944,6 @@ static bool is_idle(struct connman_service *service)
return false;
}
-static bool is_connecting(struct connman_service *service)
-{
- return is_connecting_state(service, service->state);
-}
-
-static bool is_connected(struct connman_service *service)
-{
- return is_connected_state(service, service->state);
-}
-
-
static int nameservers_changed_cb(void *user_data)
{
struct connman_service *service = user_data;
@@ -964,8 +951,8 @@ static int nameservers_changed_cb(void *user_data)
DBG("service %p", service);
service->nameservers_timeout = 0;
- if ((is_idle(service) && !service->nameservers) ||
- is_connected(service))
+ if ((is_idle(service->state) && !service->nameservers) ||
+ is_connected(service->state))
dns_changed(service);
return FALSE;
@@ -991,14 +978,14 @@ static bool nameserver_available(struct connman_service
*service,
if (type == CONNMAN_IPCONFIG_TYPE_IPV6)
return false;
- return is_connected_state(service, service->state_ipv4);
+ return is_connected(service->state_ipv4);
}
if (family == AF_INET6) {
if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
return false;
- return is_connected_state(service, service->state_ipv6);
+ return is_connected(service->state_ipv6);
}
return false;
@@ -1008,7 +995,7 @@ static int searchdomain_add_all(struct connman_service
*service)
{
int index, i = 0;
- if (!is_connected(service))
+ if (!is_connected(service->state))
return -ENOTCONN;
index = __connman_service_get_index(service);
@@ -1036,7 +1023,7 @@ static int searchdomain_remove_all(struct connman_service
*service)
{
int index, i = 0;
- if (!is_connected(service))
+ if (!is_connected(service->state))
return -ENOTCONN;
index = __connman_service_get_index(service);
@@ -1390,7 +1377,7 @@ void __connman_service_nameserver_del_routes(struct
connman_service *service,
static void address_updated(struct connman_service *service,
enum connman_ipconfig_type type)
{
- if (is_connected_state(service, service->state) &&
+ if (is_connected(service->state) &&
service == __connman_service_get_default()) {
nameserver_remove_all(service, type);
nameserver_add_all(service, type);
@@ -1496,7 +1483,7 @@ struct connman_service
*__connman_service_get_default(void)
service = service_list->data;
- if (!is_connected(service))
+ if (!is_connected(service->state))
return NULL;
return service;
@@ -1685,7 +1672,7 @@ static void append_ipv4(DBusMessageIter *iter, void
*user_data)
{
struct connman_service *service = user_data;
- if (!is_connected_state(service, service->state_ipv4))
+ if (!is_connected(service->state_ipv4))
return;
if (service->ipconfig_ipv4)
@@ -1696,7 +1683,7 @@ static void append_ipv6(DBusMessageIter *iter, void
*user_data)
{
struct connman_service *service = user_data;
- if (!is_connected_state(service, service->state_ipv6))
+ if (!is_connected(service->state_ipv6))
return;
if (service->ipconfig_ipv6)
@@ -1744,7 +1731,7 @@ static void append_dns(DBusMessageIter *iter, void
*user_data)
{
struct connman_service *service = user_data;
- if (!is_connected(service))
+ if (!is_connected(service->state))
return;
if (service->nameservers_config) {
@@ -1828,8 +1815,8 @@ static void append_domain(DBusMessageIter *iter, void
*user_data)
{
struct connman_service *service = user_data;
- if (!is_connected(service) &&
- !is_connecting(service))
+ if (!is_connected(service->state) &&
+ !is_connecting(service->state))
return;
if (service->domains)
@@ -1873,7 +1860,7 @@ static void append_proxy(DBusMessageIter *iter, void
*user_data)
const char *method = proxymethod2string(
CONNMAN_SERVICE_PROXY_METHOD_DIRECT);
- if (!is_connected(service))
+ if (!is_connected(service->state))
return;
proxy = connman_service_get_proxy_method(service);
@@ -1960,7 +1947,7 @@ static void append_provider(DBusMessageIter *iter, void
*user_data)
{
struct connman_service *service = user_data;
- if (!is_connected(service))
+ if (!is_connected(service->state))
return;
if (service->provider)
@@ -2263,7 +2250,7 @@ void __connman_service_notify(struct connman_service
*service,
if (!service)
return;
- if (!is_connected(service))
+ if (!is_connected(service->state))
return;
stats_update(service,
@@ -3304,8 +3291,7 @@ int __connman_service_reset_ipconfig(struct
connman_service *service,
new_method = __connman_ipconfig_get_method(new_ipconfig);
}
- if (is_connecting_state(service, state) ||
- is_connected_state(service, state))
+ if (is_connecting(state) || is_connected(state))
__connman_network_clear_ipconfig(service->network, ipconfig);
__connman_ipconfig_unref(ipconfig);
@@ -3315,8 +3301,7 @@ int __connman_service_reset_ipconfig(struct
connman_service *service,
else if (type == CONNMAN_IPCONFIG_TYPE_IPV6)
service->ipconfig_ipv6 = new_ipconfig;
- if (is_connecting_state(service, state) ||
- is_connected_state(service, state))
+ if (is_connecting(state) || is_connected(state))
__connman_ipconfig_enable(new_ipconfig);
if (new_state && new_method != old_method) {
@@ -3606,8 +3591,7 @@ static DBusMessage *set_property(DBusConnection *conn,
&state);
if (err < 0) {
- if (is_connected_state(service, state) ||
- is_connecting_state(service, state)) {
+ if (is_connected(state) || is_connecting(state)) {
if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
__connman_network_enable_ipconfig(service->network,
service->ipconfig_ipv4);
@@ -3624,7 +3608,8 @@ static DBusMessage *set_property(DBusConnection *conn,
else
ipv6_configuration_changed(service);
- if (is_connecting(service) || is_connected(service)) {
+ if (is_connecting(service->state) ||
+ is_connected(service->state)) {
if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
__connman_network_enable_ipconfig(service->network,
service->ipconfig_ipv4);
@@ -3856,7 +3841,7 @@ static GList *preferred_tech_list_get(void)
for (list = service_list; list; list = list->next) {
struct connman_service *service = list->data;
- if (!is_connected(service))
+ if (!is_connected(service->state))
break;
if (service->connect_reason ==
@@ -3938,8 +3923,8 @@ static bool auto_connect_service(GList *services,
}
if (service->pending ||
- is_connecting(service) ||
- is_connected(service)) {
+ is_connecting(service->state) ||
+ is_connected(service->state)) {
if (autoconnect_no_session_active(service))
return true;
@@ -4033,7 +4018,8 @@ static gboolean run_vpn_auto_connect(gpointer data) {
if (service->type != CONNMAN_SERVICE_TYPE_VPN)
continue;
- if (is_connected(service) || is_connecting(service)) {
+ if (is_connected(service->state) ||
+ is_connecting(service->state)) {
if (!service->do_split_routing)
need_split = true;
continue;
@@ -4192,7 +4178,7 @@ static DBusMessage *connect_service(DBusConnection *conn,
for (list = service_list; list; list = list->next) {
struct connman_service *temp = list->data;
- if (!is_connecting(temp) && !is_connected(temp))
+ if (!is_connecting(temp->state) && !is_connected(temp->state))
break;
if (service == temp)
@@ -4903,8 +4889,8 @@ static gint service_compare(gconstpointer a,
gconstpointer b)
state_a = service_a->state;
state_b = service_b->state;
- a_connected = is_connected(service_a);
- b_connected = is_connected(service_b);
+ a_connected = is_connected(state_a);
+ b_connected = is_connected(state_b);
if (a_connected && b_connected) {
if (service_a->order > service_b->order)
@@ -4929,9 +4915,9 @@ static gint service_compare(gconstpointer a,
gconstpointer b)
if (b_connected)
return 1;
- if (is_connecting(service_a))
+ if (is_connecting(state_a))
return -1;
- if (is_connecting(service_b))
+ if (is_connecting(state_b))
return 1;
}
@@ -5096,14 +5082,12 @@ bool __connman_service_is_connected_state(struct
connman_service *service,
case CONNMAN_IPCONFIG_TYPE_UNKNOWN:
break;
case CONNMAN_IPCONFIG_TYPE_IPV4:
- return is_connected_state(service, service->state_ipv4);
+ return is_connected(service->state_ipv4);
case CONNMAN_IPCONFIG_TYPE_IPV6:
- return is_connected_state(service, service->state_ipv6);
+ return is_connected(service->state_ipv6);
case CONNMAN_IPCONFIG_TYPE_ALL:
- return is_connected_state(service,
- CONNMAN_IPCONFIG_TYPE_IPV4) &&
- is_connected_state(service,
- CONNMAN_IPCONFIG_TYPE_IPV6);
+ return is_connected(service->state_ipv4) &&
+ is_connected(service->state_ipv6);
}
return false;
@@ -5436,7 +5420,7 @@ static void downgrade_connected_services(void)
for (list = service_list; list; list = list->next) {
up_service = list->data;
- if (!is_connected(up_service))
+ if (!is_connected(up_service->state))
continue;
if (up_service->state == CONNMAN_SERVICE_STATE_ONLINE)
@@ -5487,7 +5471,7 @@ static void single_connected_tech(struct connman_service
*allowed)
for (iter = service_list; iter; iter = iter->next) {
service = iter->data;
- if (!is_connected(service))
+ if (!is_connected(service->state))
break;
if (service == allowed)
@@ -5549,15 +5533,13 @@ static int service_indicate_state(struct
connman_service *service)
if (old_state == CONNMAN_SERVICE_STATE_ONLINE)
__connman_notifier_leave_online(service->type);
- if (is_connected_state(service, old_state) &&
- !is_connected_state(service, new_state))
+ if (is_connected(old_state) && !is_connected(new_state))
searchdomain_remove_all(service);
service->state = new_state;
state_changed(service);
- if (!is_connected_state(service, old_state) &&
- is_connected_state(service, new_state))
+ if (!is_connected(old_state) && is_connected(new_state))
searchdomain_add_all(service);
switch(new_state) {
@@ -5778,7 +5760,7 @@ int __connman_service_indicate_default(struct
connman_service *service)
{
DBG("service %p state %s", service, state2string(service->state));
- if (!is_connected(service)) {
+ if (!is_connected(service->state)) {
/*
* If service is not yet fully connected, then we must not
* change the default yet. The default gw will be changed
@@ -6026,8 +6008,7 @@ int __connman_service_ipconfig_indicate_state(struct
connman_service *service,
break;
}
- if (is_connected_state(service, old_state) &&
- !is_connected_state(service, new_state))
+ if (is_connected(old_state) && !is_connected(new_state))
nameserver_remove_all(service, type);
if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
@@ -6035,8 +6016,7 @@ int __connman_service_ipconfig_indicate_state(struct
connman_service *service,
else
service->state_ipv6 = new_state;
- if (!is_connected_state(service, old_state) &&
- is_connected_state(service, new_state))
+ if (!is_connected(old_state) && is_connected(new_state))
nameserver_add_all(service, type);
__connman_timeserver_sync(service);
@@ -6255,10 +6235,10 @@ int __connman_service_connect(struct connman_service
*service,
reason2string(service->connect_reason),
reason2string(reason));
- if (is_connected(service))
+ if (is_connected(service->state))
return -EISCONN;
- if (is_connecting(service))
+ if (is_connecting(service->state))
return -EALREADY;
switch (service->type) {
@@ -6392,7 +6372,7 @@ int __connman_service_disconnect_all(void)
for (iter = service_list; iter; iter = iter->next) {
service = iter->data;
- if (!is_connected(service))
+ if (!is_connected(service->state))
break;
services = g_slist_prepend(services, service);
@@ -6903,10 +6883,10 @@ static void update_from_network(struct connman_service
*service,
DBG("service %p network %p", service, network);
- if (is_connected(service))
+ if (is_connected(service->state))
return;
- if (is_connecting(service))
+ if (is_connecting(service->state))
return;
str = connman_network_get_string(network, "Name");
--
2.11.0
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 15, Issue 11
***************************************