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: Question about per application routing
(Liang, Jian [TYCO GBS - Cork])
2. Re: Question about per application routing (Daniel Wagner)
3. [PATCH 2/2] wifi: Don't assign unused value
(Peter Meerwald-Stadler)
4. [PATCH 1/2] inet: Fix potential double close
(Peter Meerwald-Stadler)
5. Re: [PATCH 2/2] wifi: Don't assign unused value (Daniel Wagner)
6. Re: [PATCH 1/2] inet: Fix potential double close (Daniel Wagner)
----------------------------------------------------------------------
Message: 1
Date: Fri, 21 Oct 2016 09:45:34 +0000
From: "Liang, Jian [TYCO GBS - Cork]" <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: RE: Question about per application routing
Message-ID:
<3b409afa23191042a221fe4d8b5c636031f...@003fch1mpn2-041.003f.mgd2.msft.net>
Content-Type: text/plain; charset="us-ascii"
Hi, Daniel
Thanks a lot for your suggestion. Please keep me updated if you get a chance to
find that plug-in for GENIVI as you mentioned.
On 20.10.2016 18:49, Liang, Jian [TYCO GBS - Cork] wrote:
> I am trying to understand how per application routing works with
> session APIs. Here are two questions which confused me
>
> - In the 'session-policy-format.txt' file, the provided
> example of a xxx.policy file contains a 'uid' field. Does it mean
> 'per application routing' is only applicable when applications run
> through different users?
The current application matching/identification depends on uid. The
code allows also to use different means for the matching, for example via
SELinux context. Though you need to tweak your system accordingly.
Also note that you can create your own session plugin which might fit
better into your system.
> - In session polices, is it possible to specify different
order
> of services when multiple services are of a same type of technology,
> e.g. multiple Ethernet interfaces? If not, how can it be specified
> with connman APIs or policies?
The plugins/session_policy_local.c is considered to be a good working
example on how you could write your own plugin. If you write your own plugin
you can take over the control of the main connection algorithm in ConnMan.
Obviously, you have then to do it everything by yourself.
Currently, can session policy co-exist with the main connection algorithm? I
mean, can normal applications still benefit from the ConnMan's management of
connections, while specific application that runs through a session uses
network connection differently?
I had once written an example for such a plugin. The repo was hosted on
a git server run by GENIVI. Well, it's gone. I try to find a local copy and
host it on github.
cheers,
Daniel
Regards,
Jian
________________________________
This e-mail contains privileged and confidential information intended for the
use of the addressees named above. If you are not the intended recipient of
this e-mail, you are hereby notified that you must not disseminate, copy or
take any action in respect of any information contained in it. If you have
received this e-mail in error, please notify the sender immediately by e-mail
and immediately destroy this e-mail and its attachments.
------------------------------
Message: 2
Date: Fri, 21 Oct 2016 14:37:31 +0200
From: Daniel Wagner <[email protected]>
To: "Liang, Jian [TYCO GBS - Cork]" <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: Re: Question about per application routing
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252
On 10/21/2016 11:45 AM, Liang, Jian [TYCO GBS - Cork] wrote:
> Thanks a lot for your suggestion. Please keep me updated
> if you get a chance to find that plug-in for GENIVI as you mentioned.
https://github.com/igaw/pold/blob/master/connman/0001-session_policy_pold-Add-session-plugin-for-remote-co.patch
>> The plugins/session_policy_local.c is considered to be a good
>> working example on how you could write your own plugin. If you
>> write your own plugin you can take over the control of the
>> main connection algorithm in ConnMan. Obviously, you have then
>> to do it everything by yourself.
>
> Currently, can session policy co-exist with the main connection
> algorithm?
Yes, it avoids poking into the algorithm.
> I mean, can normal applications still benefit from the
> ConnMan's management of connections, while specific application
> that runs through a session uses network connection differently?
Have a look at the struct connman_session_policy API
struct connman_session_policy {
const char *name;
int priority;
bool (*autoconnect)(enum connman_service_connect_reason reason);
int (*create)(struct connman_session *session,
connman_session_config_func_t cb,
void *user_data);
void (*destroy)(struct connman_session *session);
void (*session_changed)(struct connman_session *session, bool active,
GSList *bearers);
bool (*allowed)(struct connman_session *session,
struct connman_service *service);
};
With these hooks you can overwrite the builtin algorithm. If you
implement allowed() you can tell the connection algorithm to try
to establish a connection with given service.
The above mentioned example creates a score per service and
sorts them accordingly (calc_service_score). When a new connection
needs to be establish it will pick the one with highest score.
This is just a simple example. You can come up with something
which fits more your need.
HTH!
cheers,
daniel
------------------------------
Message: 3
Date: Fri, 21 Oct 2016 14:37:40 +0200
From: Peter Meerwald-Stadler <[email protected]>
To: [email protected]
Subject: [PATCH 2/2] wifi: Don't assign unused value
Message-ID: <[email protected]>
CID 1352483, CID 1352482
---
plugins/wifi.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 8bde9c0..3973a3a 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -590,10 +590,8 @@ static int peer_register_service(const unsigned char
*specification,
params = fill_in_peer_service_params(specification,
specification_length, query,
query_length, version);
- if (!params) {
- ret = -ENOMEM;
+ if (!params)
continue;
- }
if (!found) {
ret_f = g_supplicant_interface_p2p_add_service(iface,
@@ -678,10 +676,8 @@ static int peer_unregister_service(const unsigned char
*specification,
params = fill_in_peer_service_params(specification,
specification_length, query,
query_length, version);
- if (!params) {
- ret = -ENOMEM;
+ if (!params)
continue;
- }
ret = g_supplicant_interface_p2p_del_service(iface, params);
if (ret != 0 && ret != -EINPROGRESS)
--
1.7.10.4
------------------------------
Message: 4
Date: Fri, 21 Oct 2016 14:37:39 +0200
From: Peter Meerwald-Stadler <[email protected]>
To: [email protected]
Subject: [PATCH 1/2] inet: Fix potential double close
Message-ID: <[email protected]>
sk has already been closed and ifr has already been freed,
so just return NULL
CID 1363273
---
src/inet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/inet.c b/src/inet.c
index 69ded19..803f0e6 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -2653,7 +2653,7 @@ char **__connman_inet_get_running_interfaces(void)
result = g_try_realloc(result, (count + 1) * sizeof(char *));
if (!result) {
g_free(prev_result);
- goto error;
+ return NULL;
}
}
--
1.7.10.4
------------------------------
Message: 5
Date: Fri, 21 Oct 2016 15:42:54 +0200
From: Daniel Wagner <[email protected]>
To: Peter Meerwald-Stadler <[email protected]>, [email protected]
Subject: Re: [PATCH 2/2] wifi: Don't assign unused value
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
Hi Peter,
On 10/21/2016 02:37 PM, Peter Meerwald-Stadler wrote:
> CID 1352483, CID 1352482
> ---
> plugins/wifi.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/plugins/wifi.c b/plugins/wifi.c
> index 8bde9c0..3973a3a 100644
> --- a/plugins/wifi.c
> +++ b/plugins/wifi.c
> @@ -590,10 +590,8 @@ static int peer_register_service(const unsigned char
> *specification,
> params = fill_in_peer_service_params(specification,
> specification_length, query,
> query_length, version);
> - if (!params) {
> - ret = -ENOMEM;
> + if (!params)
> continue;
> - }
Just wondering if we should just break out of the loop with ret set to
-ENOMEM, e.g.
if (!params) {
ret = -ENOMEN;
break;
}
?
Because if don't do that we will return a different error code
-ENOTSUPP, I think.
If possible I'd like to keep the original intention here.
cheers,
daniel
------------------------------
Message: 6
Date: Fri, 21 Oct 2016 15:44:03 +0200
From: Daniel Wagner <[email protected]>
To: Peter Meerwald-Stadler <[email protected]>, [email protected]
Subject: Re: [PATCH 1/2] inet: Fix potential double close
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
On 10/21/2016 02:37 PM, Peter Meerwald-Stadler wrote:
> sk has already been closed and ifr has already been freed,
> so just return NULL
>
> CID 1363273
Patch applied.
Thanks,
Daniel
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 12, Issue 23
***************************************