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: [PATCHv2] config: Fix memory leak when realloc fails
      (Patrik Flykt)
   2. Re: [PATCH 2/2] delete STORAGEDIR folders - sources (Patrik Flykt)
   3. R: [PATCH 2/2] delete STORAGEDIR folders - sources
      (MANIEZZO Marco (MM))
   4. Re: [PATCH] Add AlwaysUseFallbackNameservers flag in the
      configuration file. (Grant Erickson)
   5. Re: [PATCH] gdhcp: use opened listening socket to send DHCP
      renew request (wangfe-nestlabs)


----------------------------------------------------------------------

Message: 1
Date: Fri, 26 Feb 2016 15:26:40 +0200
From: Patrik Flykt <[email protected]>
To: Nishant Chaprana <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [PATCHv2] config: Fix memory leak when realloc fails
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"

On Thu, 2016-02-25 at 12:30 +0530, Nishant Chaprana wrote:
> This patch fixes realloc failure case, when realloc fails it
> returns NULL and previously allocated memory was getting lost in
> this scenario, So all memory should be freed before returning.

Applied, thanks!

        Patrik



------------------------------

Message: 2
Date: Fri, 26 Feb 2016 15:57:08 +0200
From: Patrik Flykt <[email protected]>
To: Marco Maniezzo <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 2/2] delete STORAGEDIR folders - sources
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"

On Fri, 2016-02-26 at 10:57 +0100, Marco Maniezzo wrote:
> ---
>  include/provision.h |  1 +
>  src/config.c        |  9 +++++++++
>  src/service.c       | 35 +++++++++++++++++++++++++++++++----
>  3 files changed, 41 insertions(+), 4 deletions(-)
> 
> diff --git a/include/provision.h b/include/provision.h
> index 3eb80a8..040f152 100644
> --- a/include/provision.h
> +++ b/include/provision.h
> @@ -42,6 +42,7 @@ struct connman_config_entry {
>       bool hidden;
>  };
>  
> +void reload_config(const char * ident);
>  int connman_config_provision_mutable_service(GKeyFile *keyfile);
>  struct connman_config_entry **connman_config_get_entries(const char *type);
>  void connman_config_free_entries(struct connman_config_entry **entries);
> diff --git a/src/config.c b/src/config.c
> index 344b8ce..da95817 100644
> --- a/src/config.c
> +++ b/src/config.c
> @@ -942,6 +942,15 @@ static void config_notify_handler(struct inotify_event 
> *event,
>               g_hash_table_remove(config_table, ident);
>  }
>  
> +void reload_config(const char * ident)
> +{
> +     struct inotify_event event;
> +
> +     event.mask = IN_MODIFY;
> +
> +     config_notify_handler(&event,ident);

There can be more than one services specified in the same configuration
file. With the above all other services will also be disrupted, which is
not nice if another service is connected while trying to remove the
other one from the same file.

> +}
> +
>  int __connman_config_init(void)
>  {
>       DBG("");
> diff --git a/src/service.c b/src/service.c
> index 8e07337..a0475f2 100644
> --- a/src/service.c
> +++ b/src/service.c
> @@ -34,7 +34,7 @@
>  #include <connman/storage.h>
>  #include <connman/setting.h>
>  #include <connman/agent.h>
> -
> +#include <connman/provision.h>
>  #include "connman.h"
>  
>  #define CONNECT_TIMEOUT              120
> @@ -4081,11 +4081,15 @@ static DBusMessage *disconnect_service(DBusConnection 
> *conn,
>  
>  bool __connman_service_remove(struct connman_service *service)
>  {
> +     unsigned int *auto_connect_types;
> +     char *ident;
> +     int i;
> +
>       if (service->type == CONNMAN_SERVICE_TYPE_ETHERNET ||
>                       service->type == CONNMAN_SERVICE_TYPE_GADGET)
>               return false;
>  
> -     if (service->immutable || service->hidden ||
> +     if (service->hidden ||
>                       __connman_provider_is_immutable(service->provider))
>               return false;
>  
> @@ -4116,9 +4120,32 @@ bool __connman_service_remove(struct connman_service 
> *service)
>  
>       __connman_ipconfig_ipv6_reset_privacy(service->ipconfig_ipv6);
>  
> -     service_save(service);
> +     __connman_storage_remove_service(service->identifier);
>  
> -     return true;
> +     if (service->immutable == true && service->config_file)
> +     {/* force reprovision of immutable services */
> +
> +             /* reset autoconnect to default, because it is not currently 
> (connman 1.31)
> +              * managed by .config files
> +              */
> +             auto_connect_types = 
> connman_setting_get_uint_list("DefaultAutoConnectTechnologies");
> +             service->autoconnect = false;
> +             for (i = 0; auto_connect_types &&
> +             auto_connect_types[i] != 0; i++) {
> +                     if (service->type == auto_connect_types[i]) {
> +                             service->autoconnect = true;
> +                             break;
> +                     }
> +             }
> +

All settings added by the user shall be removed. I wonder if the removal
can be combined with refactored parts of service_free(), as the service
is stripped of all extra values there. When adding the service back in a
fresh state, reprovisioning can be impelmented to happen for just this
service, but it may also be easier to do
__connman_service_create_from_network() here.

> +             DBG("reloading service %s", service->config_file);
> +
> +             ident = g_strdup_printf("%s.config", service->config_file);
> +             reload_config(ident);
> +             g_free(ident);
> +     }
> +
> +     return(true);
>  }
>  
>  static DBusMessage *remove_service(DBusConnection *conn,

Let me think about this a while, meanwhile comments are welcome.

Cheers,

        Patrik




------------------------------

Message: 3
Date: Fri, 26 Feb 2016 15:04:06 +0000
From: "MANIEZZO Marco (MM)" <[email protected]>
To: Patrik Flykt <[email protected]>, Marco Maniezzo
        <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: R: [PATCH 2/2] delete STORAGEDIR folders - sources
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hello Patrik,


>> +void reload_config(const char * ident) {
>> +struct inotify_event event;
>> +
>> +event.mask = IN_MODIFY;
>> +
>> +config_notify_handler(&event,ident);

>There can be more than one services specified in the same configuration file. 
>With the above all other services will also be disrupted, which is not nice if 
>another service is connected while trying to remove the other one from the 
>same file.

You're right, they would be re-provisioned as well, meaning reset to default. 
And the same currently happens if the user manually modifies the .config file 
for one service only, the config_notify_handler has to be revised

>> +if (service->immutable == true && service->config_file)
>> +{/* force reprovision of immutable services */
>> +
>> +/* reset autoconnect to default, because it is not currently (connman 1.31)
>> + * managed by .config files
>> + */
>> +auto_connect_types = 
>> connman_setting_get_uint_list("DefaultAutoConnectTechnologies");
>> +service->autoconnect = false;
>> +for (i = 0; auto_connect_types &&
>> +auto_connect_types[i] != 0; i++) {
>> +if (service->type == auto_connect_types[i]) {
>> +service->autoconnect = true;
>> +break;
>> +}
>> +}
>> +

>All settings added by the user shall be removed. I wonder if the removal can 
>be combined with refactored parts of service_free(), as the service is 
>stripped of all extra values there. When adding the service back in a fresh 
>state, reprovisioning can be impelmented to happen for just this service, but 
>it may also be easier to do
>__connman_service_create_from_network() here.

Yes it should be completed by clearing all the properties that the re-provision 
is going to provide after. Here I kept the clears already present plus I added 
only autoconnect which can be modified by d-bus but it is not read from .config 
files so it would stay at the last value instead of being reset.

I've done a fast test with 
__connman_service_create_from_network(service->network) instead of 
reload_config(ident) and passphrase at least is not re-read so it would need 
some modification more to work.

Marco


________________________________

VISITA IL NOSTRO NUOVO SITO WEB! - VISIT OUR NEW WEB SITE! 
www.magnetimarelli.com

Confidential Notice: This message - including its attachments - may contain 
proprietary, confidential and/or legally protected information and is intended 
solely for the use of the designated addressee(s) above. If you are not the 
intended recipient be aware that any downloading, copying, disclosure, 
distribution or use of the contents of the above information is strictly 
prohibited.
If you have received this communication by mistake, please forward the message 
back to the sender at the email address above, delete the message from all 
mailboxes and any other electronic storage medium and destroy all copies.
Disclaimer Notice: Internet communications cannot be guaranteed to be safe or 
error-free. Therefore we do not assure that this message is complete or 
accurate and we do not accept liability for any errors or omissions in the 
contents of this message.


------------------------------

Message: 4
Date: Fri, 26 Feb 2016 07:52:56 -0800
From: Grant Erickson <[email protected]>
To: Patrik Flykt <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] Add AlwaysUseFallbackNameservers flag in the
        configuration file.
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8

On Feb 26, 2016, at 1:57 AM, [email protected] wrote:
> On Thu, 2016-02-25 at 10:52 -0800, wangfe-nestlabs wrote:
>> Background information.
>> 
>> Connmand will not use fallback name servers when some name servers are
>> provided by DHCP reply.  But in some cases, the ISP provided its own
>> name servers can?t be down, then DNS won?t work.  So some requirement
>> is to use some fallback name severs such as 8.8.8.8, 8.8.4.4 for
>> backup.
>> 
>> Add the option flag ?AlwaysUseFallbackNameservers?.  Which it is
>> enabled, the fallback name servers are appended to name server list,
>> and will be used. The duplicate servers will be filtered out in the
>> __connman_service_nameserver_append.
> 
> NACK. FallBackNameservers are just that, a list of servers to use when
> there are zero nameservers provided otherwise. Every service has already
> a Nameservers.Configuration attribute which takes precedence over the
> ones provided by DHCP.

Patrik,

It?s easy to see how this is done one-off, statically for a provision or via a 
per-service-specific configuration setting using Nameservers.Configuration.

However, what?s the recommended way to ensure that nameservers can be 
configured, via Nameservers.Configuration, and applied to all services, without 
regard to their technology type or the service name?

The use case here is that a particular ISP supplies DNS servers in DHCP. 
However, their DNS servers are notoriously flaky and non-responsive (i.e. 
failed average response rate is high). Consequently, given how conman?s DNS 
proxy functions, statically-configured servers are a stopgap guarantee that 
will work even when the DHCP-provided servers do not.

Best,

Grant

------------------------------

Message: 5
Date: Fri, 26 Feb 2016 08:36:28 -0800
From: wangfe-nestlabs <[email protected]>
To: Patrik Flykt <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] gdhcp: use opened listening socket to send DHCP
        renew request
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Hi Patrik,

Please see the answers embedded.

Thanks,

Feng


> On Feb 25, 2016, at 11:42 PM, Patrik Flykt <[email protected]> 
> wrote:
> 
> On Wed, 2016-02-24 at 11:32 -0800, Feng Wang wrote:
>> But in some cases, the socket is closed after the DHCP ACK is
>> received.
> 
> What are these cases on ConnMan side where the socket is closed after
> the ACK is received? Or what code path does the code take in that case?
> Isn't it easier to identify that code path or special case and figure
> out if there is an easier solution fixing it?
> 
 For ConnMan side, the code path is no difference.  The difference is when 
trying to close the socket in the ConnMan, the socket was NOT closed 
immediately because the close function can be rescheduled or there are some 
packets just rxed, the close will happen later.   And the main point is why 
using two sockets(one is for transmitting and one is for receiving) instead of 
one socket both for tx and rx?

> Cheers,
> 
>       Patrik
> 
> 
> 



------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 4, Issue 35
**************************************

Reply via email to