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: [RFC] Proposal for ConnMan session API extensions
(Daniel Wagner)
2. Re: [PATCH] service: Add EnableOnlineCheck config option
(Daniel Wagner)
3. Re: [PATCH] gsupplicant: Use ConfigFile when recreating an
interface (Daniel Wagner)
4. Re: [PATCH] inet: Prevent glib source from being removed
twice (Daniel Wagner)
5. Re: [PATCH] inet: Don't close file descriptor twice
(Daniel Wagner)
6. [PATCH] inet: Prevent glib source from being removed twice
(Slava Monich)
7. Re: [PATCH] service: Add EnableOnlineCheck config option
(Lukasz Nowak)
----------------------------------------------------------------------
Message: 1
Date: Sun, 29 Jan 2017 21:18:47 +0100
From: Daniel Wagner <[email protected]>
To: "Achtzehn Andreas (CM/ENA4)" <[email protected]>,
Lukasz Nowak <[email protected]>, "Nakamura, Yusuke (ADITJ/SWG)"
<[email protected]>
Cc: "[email protected]" <[email protected]>, "Hoyer Marko
(ADITG/SWG)" <[email protected]>, "EXTERNAL Thorwirth Bjoern
(Brunel, CM-CI1/ERN5-E)" <[email protected]>,
"Ishikawa, Tetsuri (ADITJ/SWG)" <[email protected]>
Subject: Re: [RFC] Proposal for ConnMan session API extensions
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
Hi Andreas,
On 01/26/2017 05:44 PM, Achtzehn Andreas (CM/ENA4) wrote:
> Hi Daniel,
>
> Sorry for not getting back earlier. Comments are inline.
No worries :)
> On Sun Jan 22 11:47:43 PST 2017 Daniel Wagner wrote:
>> On 01/16/2017 02:00 PM, Nakamura, Yusuke (ADITJ/SWG) wrote:
>>> We would like to propose two extensions to the session API interface of
>>> ConnMan. The first extension enables a service differentiation for
>>> processes run by the same user.It allows ConnMan to differentiate
>>> between bearer usage permissions and the respective priorities based on
>>> the requested service type.
>>
>> That should also be possible with the current code. You might need to
>> write your own session plugin for this though. It is quite hard to
>> support all types of application/user identification out of the box
>> because it depends heavily on the system integrator's choices.
>> [...]
>> When we were discussing the initial API design, the exact same proposal
>> for application identification was on the table. Marcel convinced me
>> that this is a rather bad idea. Mainly because you need to trust the
>> application to provide the correct ID. There is nothing which stops any
>> random application to set the magic ID to get full connectivity.
>
> We principally would not trust the provided service information
> alone.
> The idea is to have the authentication of the application still
> implemented through UID/GID/LSM, but allow the application to select
> from different operational contexts. To elaborate on the example of the
> web browser, the browser would know that it's now acting as facebook
> client and would inform ConnMan so in session establishment phase or
> through a Change call. Then, ConnMan may apply a different list of
> AllowedBearers (the selection and/or priority ordering may change) and
> connect the application to a different bearer. Naturally, the service
> tag will not be a security feature as the application may freely select
> from the defined service scopes. Nevertheless, it would ease bearer
> management for our application case (relieving the application from
> manually changing the AllowedBearer list).
So the problem is that the application such as a web browser expects
different configuration depending on the web site is serves. Now I
remember those use cases :)
If I understood you correctly, your problem is that you create several
sessions but you don't know which does what? And the ID would tell
ConnMan to apply the right configuration.
> The modification would require an optional setting ("service"), for
> which we would require to adjust also the session.c.
>
>> I do not really follow the argumentation on the numbers of IP addresses
>> and bearers. Are you trying to match several 'virtual machines' with one
>> session? A Session is thought to be only used by one entity, until now
>> that would a single application.
>
> The different IP addresses would allow us to have several concurrent
> service paths from a single entitity, similar to Lukasz patch for a
> local application that would then use, e.g., bind-before-connect. The
> reason for having different IPs is exactly about the concurrency issue
> that we foresee when a single user has multiple paths open at the same
> time (different apps, etc.).
>
> One more subtle difference is that our source IP extension would act
> on the forwarding behavior of the host running ConnMan. In Lukasz patch
> the rule is applied to a netfilter chain that is acting on local
> processes instead. Our proposal may therefore be used for implementing,
> e.g., a webservice on a router running ConnMan which would enable
> forwarding after authentication (just one example). This also changes
> the meaning of "source IP" in our case. For Lukasz patch the source IP
> apparently matches a local interface on the host running ConnMan, while
> for us it's (as Lukasz I think pointed out already) an arbitrary source IP.
Thanks for the detailed explanation. This really helps understanding
what you are trying to solve. ConnMan so far ignored all non local use
cases. The Session API was also designed in this way. I haven't really
thought it through it yet so I can't really say something useful at this
point. Let me think a bit on this.
I am sorry not to give you a proper answer, it's getting a bit late :)
Thanks,
Daniel
------------------------------
Message: 2
Date: Sun, 29 Jan 2017 21:20:30 +0100
From: Daniel Wagner <[email protected]>
To: Lukasz Nowak <[email protected]>, [email protected]
Subject: Re: [PATCH] service: Add EnableOnlineCheck config option
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
Hi Lukasz,
On 01/26/2017 06:51 PM, Lukasz Nowak wrote:
> From: Lukasz Nowak <[email protected]>
>
> Global config option, which allows to enable/disable (enabled by default)
> use of http get in wispr to transition a default service from READY to
> ONLINE state.
Isn't
./configure --disable-wispr
good enough?
Thanks,
Daniel
------------------------------
Message: 3
Date: Sun, 29 Jan 2017 21:34:43 +0100
From: Daniel Wagner <[email protected]>
To: [email protected], [email protected],
[email protected]
Subject: Re: [PATCH] gsupplicant: Use ConfigFile when recreating an
interface
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
Hi,
On 01/27/2017 10:05 AM, [email protected] wrote:
> From: Jose Blanquicet <[email protected]>
>
> Currently, each time ConnMan removes a wpa_s interface the configuration of
> the
> wpa_s for that interface is lost (See use cases below), such configuration is
> present in the file passed to wpa_s using "-c" option. It is due to wpa_s
> did not provide the configuration file path to the applications on top of it
> (ConnMan in this case) in order to allow them to recreate interfaces with the
> same configuration they were initially created.
>
> In order to solve this we proposed a patch to wpa_s community, that patch
> aimed
> to expose the configuration file path as a D-Bus interface property. It was
> applied (b44d9c7) and delivered on last wpa_s release (2.6). Now, ConnMan has
> the possibility to recreate interfaces with the correct configuration file
> path
> in order to solve the described issue.
>
> Two use cases are the following:
>
> 1. Enable/Disable WiFi: All wpa_s interfaces are removed then config
> information
> is lost for all of them.
> 2. Tethering: When enabling, the selected wpa_s interface is removed and
> recreated with the bridge "tether". Also when disabling, again the tethering
> wpa_s interface is removed and recreated without bridge. After
> enabling/disabling tethering the config information of that interface is lost.
>
> This patch aims to solve the just described issue by using the new interface's
> property exposed by wpa_s via D-Bus in order to always recreate the interfaces
> with the appropriate configuration. This modification only has effect if wpa_s
> is updated to release 2.6 or at least includes commit b44d9c7 (Applied on
> 2016-08-23), otherwise ConnMan will simply do not send any ConfigFile while
> creating a new interface as it has been doing so far.
Patch applied.
Thanks,
Daniel
------------------------------
Message: 4
Date: Sun, 29 Jan 2017 21:44:43 +0100
From: Daniel Wagner <[email protected]>
To: Slava Monich <[email protected]>, [email protected]
Subject: Re: [PATCH] inet: Prevent glib source from being removed
twice
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
Hi Slava,
On 01/27/2017 06:43 PM, Slava Monich wrote:
> If GIOFunc callback returns FALSE, the event source is removed
> by glib. We either call g_source_remove or remove FALSE from the
> callback. If we do both, the source is getting removed twice which
> glib considers a critical error.
Good catch.
I understand that G_SOURCE_CONTINUE and G_SOURCE_REMOVE are also valid
return values. The documentation and also the function definition is
using gboolean as function signature. So TRUE and FALSE are better match
even though less clear what it means. We have plenty of those
in our code base and I think it's better to stick to them instead of
introducing partial G_SOURCE_CONTINUE and G_SOURCE_REMOVE.
> ---
> src/inet.c | 66
> +++++++++++++++++++++++++++++++++++---------------------------
> 1 file changed, 37 insertions(+), 29 deletions(-)
>
> diff --git a/src/inet.c b/src/inet.c
> index 8e88054..f2b5b72 100644
> --- a/src/inet.c
> +++ b/src/inet.c
> @@ -1252,13 +1252,12 @@ static gboolean rs_timeout_cb(gpointer user_data)
> return FALSE;
> }
>
> -static int icmpv6_recv(int fd, gpointer user_data)
> +static int icmpv6_recv(int fd, struct xs_cb_data *data)
> {
> struct msghdr mhdr;
> struct iovec iov;
> unsigned char chdr[CMSG_BUF_LEN];
> unsigned char buf[1540];
> - struct xs_cb_data *data = user_data;
> struct nd_router_advert *hdr;
> struct sockaddr_in6 saddr;
> ssize_t len;
> @@ -1280,7 +1279,6 @@ static int icmpv6_recv(int fd, gpointer user_data)
> len = recvmsg(fd, &mhdr, 0);
> if (len < 0) {
> cb(NULL, 0, data->user_data);
> - xs_cleanup(data);
> return -errno;
> }
>
> @@ -1291,26 +1289,30 @@ static int icmpv6_recv(int fd, gpointer user_data)
> return 0;
>
> cb(hdr, len, data->user_data);
> - xs_cleanup(data);
>
> return len;
> }
>
> -static gboolean icmpv6_event(GIOChannel *chan, GIOCondition cond, gpointer
> data)
> +static gboolean icmpv6_event(GIOChannel *chan, GIOCondition cond,
> + gpointer user_data)
not really needed.
> -static int icmpv6_nd_recv(int fd, gpointer user_data)
> +static int icmpv6_nd_recv(int fd, struct xs_cb_data *data)
> {
> struct msghdr mhdr;
> struct iovec iov;
> unsigned char chdr[CMSG_BUF_LEN];
> unsigned char buf[1540];
> - struct xs_cb_data *data = user_data;
> struct nd_neighbor_advert *hdr;
> struct sockaddr_in6 saddr;
> ssize_t len;
> @@ -1825,7 +1828,6 @@ static int icmpv6_nd_recv(int fd, gpointer user_data)
> len = recvmsg(fd, &mhdr, 0);
> if (len < 0) {
> cb(NULL, 0, &data->addr.sin6_addr, data->user_data);
> - xs_cleanup(data);
> return -errno;
> }
>
> @@ -1844,27 +1846,30 @@ static int icmpv6_nd_recv(int fd, gpointer user_data)
> return 0;
>
> cb(hdr, len, &data->addr.sin6_addr, data->user_data);
> - xs_cleanup(data);
>
> return len;
> }
>
> static gboolean icmpv6_nd_event(GIOChannel *chan, GIOCondition cond,
> - gpointer data)
> + gpointer user_data)
another unnecessary whitespace change.
Thanks,
Daniel
------------------------------
Message: 5
Date: Sun, 29 Jan 2017 21:48:10 +0100
From: Daniel Wagner <[email protected]>
To: Slava Monich <[email protected]>, [email protected]
Subject: Re: [PATCH] inet: Don't close file descriptor twice
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
Hi Slava,
On 01/27/2017 07:48 PM, Slava Monich wrote:
> Channels created by __connman_inet_rtnl_talk shouldn't close the
> file descriptor, it's done by __connman_inet_rtnl_close.
Patch applied.
Thanks,
Daniel
------------------------------
Message: 6
Date: Sun, 29 Jan 2017 23:09:02 +0200
From: Slava Monich <[email protected]>
To: [email protected]
Subject: [PATCH] inet: Prevent glib source from being removed twice
Message-ID: <[email protected]>
If GIOFunc callback returns FALSE, the event source is removed
by glib. We either call g_source_remove or return FALSE from the
callback. If we do both, the source is getting removed twice which
glib considers a critical error.
---
src/inet.c | 49 ++++++++++++++++++++++++++++---------------------
1 file changed, 28 insertions(+), 21 deletions(-)
diff --git a/src/inet.c b/src/inet.c
index 553b57a..2c860cf 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -1252,13 +1252,12 @@ static gboolean rs_timeout_cb(gpointer user_data)
return FALSE;
}
-static int icmpv6_recv(int fd, gpointer user_data)
+static int icmpv6_recv(int fd, struct xs_cb_data *data)
{
struct msghdr mhdr;
struct iovec iov;
unsigned char chdr[CMSG_BUF_LEN];
unsigned char buf[1540];
- struct xs_cb_data *data = user_data;
struct nd_router_advert *hdr;
struct sockaddr_in6 saddr;
ssize_t len;
@@ -1280,7 +1279,6 @@ static int icmpv6_recv(int fd, gpointer user_data)
len = recvmsg(fd, &mhdr, 0);
if (len < 0) {
cb(NULL, 0, data->user_data);
- xs_cleanup(data);
return -errno;
}
@@ -1291,7 +1289,6 @@ static int icmpv6_recv(int fd, gpointer user_data)
return 0;
cb(hdr, len, data->user_data);
- xs_cleanup(data);
return len;
}
@@ -1299,17 +1296,21 @@ static int icmpv6_recv(int fd, gpointer user_data)
static gboolean icmpv6_event(GIOChannel *chan, GIOCondition cond, gpointer
data)
{
int fd, ret;
+ struct xs_cb_data *xs_data = data;
DBG("");
if (cond & (G_IO_NVAL | G_IO_HUP | G_IO_ERR))
- return FALSE;
+ goto remove;
fd = g_io_channel_unix_get_fd(chan);
- ret = icmpv6_recv(fd, data);
+ ret = icmpv6_recv(fd, xs_data);
if (ret == 0)
return TRUE;
+remove:
+ xs_data->watch_id = 0;
+ xs_cleanup(xs_data);
return FALSE;
}
@@ -1667,13 +1668,12 @@ void __connman_inet_ipv6_stop_recv_rs(void *context)
xs_cleanup(context);
}
-static int icmpv6_rs_recv(int fd, gpointer user_data)
+static int icmpv6_rs_recv(int fd, struct xs_cb_data *data)
{
struct msghdr mhdr;
struct iovec iov;
unsigned char chdr[CMSG_BUF_LEN];
unsigned char buf[1540];
- struct xs_cb_data *data = user_data;
struct nd_router_solicit *hdr;
struct sockaddr_in6 saddr;
ssize_t len;
@@ -1712,17 +1712,20 @@ static gboolean icmpv6_rs_event(GIOChannel *chan,
GIOCondition cond,
gpointer data)
{
int fd, ret;
+ struct xs_cb_data *xs_data = data;
DBG("");
if (cond & (G_IO_NVAL | G_IO_HUP | G_IO_ERR))
- return FALSE;
+ goto remove;
fd = g_io_channel_unix_get_fd(chan);
- ret = icmpv6_rs_recv(fd, data);
+ ret = icmpv6_rs_recv(fd, xs_data);
if (ret == 0)
return TRUE;
+remove:
+ xs_data->watch_id = 0;
return FALSE;
}
@@ -1797,13 +1800,12 @@ static gboolean ns_timeout_cb(gpointer user_data)
return FALSE;
}
-static int icmpv6_nd_recv(int fd, gpointer user_data)
+static int icmpv6_nd_recv(int fd, struct xs_cb_data *data)
{
struct msghdr mhdr;
struct iovec iov;
unsigned char chdr[CMSG_BUF_LEN];
unsigned char buf[1540];
- struct xs_cb_data *data = user_data;
struct nd_neighbor_advert *hdr;
struct sockaddr_in6 saddr;
ssize_t len;
@@ -1825,7 +1827,6 @@ static int icmpv6_nd_recv(int fd, gpointer user_data)
len = recvmsg(fd, &mhdr, 0);
if (len < 0) {
cb(NULL, 0, &data->addr.sin6_addr, data->user_data);
- xs_cleanup(data);
return -errno;
}
@@ -1844,7 +1845,6 @@ static int icmpv6_nd_recv(int fd, gpointer user_data)
return 0;
cb(hdr, len, &data->addr.sin6_addr, data->user_data);
- xs_cleanup(data);
return len;
}
@@ -1853,17 +1853,21 @@ static gboolean icmpv6_nd_event(GIOChannel *chan,
GIOCondition cond,
gpointer data)
{
int fd, ret;
+ struct xs_cb_data *xs_data = data;
DBG("");
if (cond & (G_IO_NVAL | G_IO_HUP | G_IO_ERR))
- return FALSE;
+ goto remove;
fd = g_io_channel_unix_get_fd(chan);
- ret = icmpv6_nd_recv(fd, data);
+ ret = icmpv6_nd_recv(fd, xs_data);
if (ret == 0)
return TRUE;
+remove:
+ xs_data->watch_id = 0;
+ xs_cleanup(xs_data);
return FALSE;
}
@@ -2188,9 +2192,8 @@ static gboolean inet_rtnl_timeout_cb(gpointer user_data)
return FALSE;
}
-static int inet_rtnl_recv(GIOChannel *chan, gpointer user_data)
+static int inet_rtnl_recv(GIOChannel *chan, struct inet_rtnl_cb_data
*rtnl_data)
{
- struct inet_rtnl_cb_data *rtnl_data = user_data;
struct __connman_inet_rtnl_handle *rth = rtnl_data->rtnl;
struct nlmsghdr *h = NULL;
struct sockaddr_nl nladdr;
@@ -2262,7 +2265,7 @@ static int inet_rtnl_recv(GIOChannel *chan, gpointer
user_data)
rtnl_data->callback(h, rtnl_data->user_data);
- inet_rtnl_cleanup(rtnl_data);
+ return 1;
}
return 0;
@@ -2272,16 +2275,20 @@ static gboolean inet_rtnl_event(GIOChannel *chan,
GIOCondition cond,
gpointer user_data)
{
int ret;
+ struct inet_rtnl_cb_data *rtnl_data = user_data;
DBG("");
if (cond & (G_IO_NVAL | G_IO_HUP | G_IO_ERR))
- return FALSE;
+ goto remove;
- ret = inet_rtnl_recv(chan, user_data);
+ ret = inet_rtnl_recv(chan, rtnl_data);
if (ret != 0)
return TRUE;
+remove:
+ rtnl_data->watch_id = 0;
+ inet_rtnl_cleanup(rtnl_data);
return FALSE;
}
--
1.9.1
------------------------------
Message: 7
Date: Mon, 30 Jan 2017 14:55:53 +0000
From: Lukasz Nowak <[email protected]>
To: Daniel Wagner <[email protected]>, [email protected]
Subject: Re: [PATCH] service: Add EnableOnlineCheck config option
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252
Hi Daniel,
The --disable-wispr switch does not disable the online http check.
The src/wispr.c is executed unconditionally from service.c right now.
Lukasz
On 29/01/17 20:20, Daniel Wagner wrote:
> Hi Lukasz,
>
> On 01/26/2017 06:51 PM, Lukasz Nowak wrote:
>> From: Lukasz Nowak <[email protected]>
>>
>> Global config option, which allows to enable/disable (enabled by default)
>> use of http get in wispr to transition a default service from READY to
>> ONLINE state.
>
> Isn't
>
> ./configure --disable-wispr
>
> good enough?
>
> Thanks,
> Daniel
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 15, Issue 39
***************************************