Send connman mailing list submissions to
        connman@lists.01.org

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
        connman-requ...@lists.01.org

You can reach the person managing the list at
        connman-ow...@lists.01.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. Re: [RFC 0/4] Too many DBG() on default (Daniel Wagner)
   2. Re: [PATCH] ntp: fix bad invalid timeout value. (Patrik Flykt)
   3. Re: [PATCH] ntp: fix bad invalid timeout value. (Antoine Aubert)
   4. [PATCH] service: Update nameservers automatically (Patrik Flykt)
   5. How to stop connection procedure? (Fabio Emiliani)


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

Message: 1
Date: Fri, 14 Oct 2016 08:51:09 +0200
From: Daniel Wagner <w...@monom.org>
To: Patrik Flykt <patrik.fl...@linux.intel.com>, connman@lists.01.org
Cc: Daniel Wagner <daniel.wag...@bmw-carit.de>
Subject: Re: [RFC 0/4] Too many DBG() on default
Message-ID: <1dbcf995-f674-3209-945b-f522ed12d...@monom.org>
Content-Type: text/plain; charset=utf-8; format=flowed

>> connmand[16807]:
>> src/ipconfig.c:__connman_ipconfig_append_ipv6config()
>> [...]
>
> Yes, just remove these. There are more in src/service.c to chop.

Okay, I'll spin a few patches for it.

>> connmand[16807]: src/dnsproxy.c:forward_dns_reply() Received 146
>> bytes (id 0x015a)
>> connmand[16807]: src/dnsproxy.c:udp_listener_event() Received 37
>> bytes (id 0x7bb2)
>> c
>>
>> I did a quick hack to get a discussion going on the idea to support
>> debug levels? What do you think on this?
>
> At least the aboe low-level dnsproxy ones make sense with -d
> src/dnsproxy.c

My point is that if you provide only '-d' we get those low level 
dnsproxy DBGs which spam the output.

Another idea would be to enable low level debugs only on exact match, 
e.g only show them if '-d src/dnsproxy.c' was given and not on '-d'.

>> Or should I just do the same with dnsproxy as we have with these
>> here:
>>
>> README:    CONNMAN_DHCP_DEBUG        DHCPv4 related debug information
>> README:    CONNMAN_DHCPV6_DEBUG      DHCPv6 related debug information
>> README:    CONNMAN_IPTABLES_DEBUG    Extra information when iptables is used
>> README:    CONNMAN_RESOLV_DEBUG      Name resolver debug prints. These debug 
>> prints
>> README:    CONNMAN_SUPPLICANT_DEBUG  Debugging prints for communication 
>> between
>> README:    CONNMAN_WEB_DEBUG         Debug information when ConnMan does 
>> Internet
>
> The CONNMAN_*_DEBUG were used for the "external" components in ./gdhcp,
> ./gsupplicant and ./gweb. The rest in ./src and ./plugins follow the -d
> option.

Ah yes, that was the reason for those ones. Well, if we would have the 
concept of exact match we could apply it to these ones as well.

(and it seems I forgot to add CONNMAN_NFTABLES_DEBUG)

cheers,
daniel


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

Message: 2
Date: Fri, 14 Oct 2016 12:28:17 +0300
From: Patrik Flykt <patrik.fl...@linux.intel.com>
To: Antoine Aubert <a.aub...@overkiz.com>, connman@lists.01.org
Subject: Re: [PATCH] ntp: fix bad invalid timeout value.
Message-ID: <1476437297.25611.23.ca...@linux.intel.com>
Content-Type: text/plain; charset="UTF-8"


        Hi,

On Wed, 2016-10-12 at 18:41 +0200, Antoine Aubert wrote:
> ????????timeout_id = g_timeout_add_seconds(timeout, send_timeout,
> -???????????????????????????????????????GUINT_TO_POINTER(timeout));

The GUINT_TO_POINTER() writes the value of 'timeout' into the user data
pointer variable; it does not reference the address of the stack
variable 'timeout'.

Cheers,

        Patrik



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

Message: 3
Date: Fri, 14 Oct 2016 13:56:14 +0200
From: Antoine Aubert <a.aub...@overkiz.com>
To: Patrik Flykt <patrik.fl...@linux.intel.com>, connman@lists.01.org
Subject: Re: [PATCH] ntp: fix bad invalid timeout value.
Message-ID: <d7d37805-ba94-91cc-1f94-758b64c7c...@overkiz.com>
Content-Type: text/plain; charset=utf-8

Thx for your answer.

Indeed I was wrong on the stack @, but according to glib doc

#define GUINT_TO_POINTER(u) ((gpointer) (gulong) (u))

It's just a cast to a gpointer. Here we use a pointer storage, to store
an uint, implying size(gpointer) always >= size(gulong) ?

Am I wrong ? Is it really safe ?

Antoine Aubert
a.aub...@overkiz.com

Le 14/10/2016 ? 11:28, Patrik Flykt a ?crit :
>       Hi,
>
> On Wed, 2016-10-12 at 18:41 +0200, Antoine Aubert wrote:
>>         timeout_id = g_timeout_add_seconds(timeout, send_timeout,
>> -                                       GUINT_TO_POINTER(timeout));
> The GUINT_TO_POINTER() writes the value of 'timeout' into the user data
> pointer variable; it does not reference the address of the stack
> variable 'timeout'.
>
> Cheers,
>
>       Patrik
>




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

Message: 4
Date: Fri, 14 Oct 2016 15:33:23 +0300
From: Patrik Flykt <patrik.fl...@linux.intel.com>
To: connman@lists.01.org
Subject: [PATCH] service: Update nameservers automatically
Message-ID: <20161014123323.22320-1-patrik.fl...@linux.intel.com>

Automatically update nameserver information when they are appended
or removed. Create a zero second timeout so that nameservers can
be appended or removed in a loop one by one with only one D-Bus
PropertyChanged signal being sent.

Verify that the service is either connected or the nameservers have
been removed when the service is inactive before sending the
PropertyChanged signal.
---

        Hi,

Here is a patch that updates nameserver info also if it changes while a
service is connected. The issue was reported by Thomas Green a long time
ago end of August, but at that point I had a bit wrong idea on how to fix
the issue. So here is hopefully a solution that works in all cases.

Please test,

       Patrik


src/service.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 54 insertions(+), 2 deletions(-)

diff --git a/src/service.c b/src/service.c
index ee10e6c..6877b9a 100644
--- a/src/service.c
+++ b/src/service.c
@@ -92,6 +92,7 @@ struct connman_service {
        char **nameservers;
        char **nameservers_config;
        char **nameservers_auto;
+       int nameservers_timeout;
        char **domains;
        char *hostname;
        char *domainname;
@@ -133,6 +134,7 @@ static struct connman_ipconfig *create_ip4config(struct 
connman_service *service
                int index, enum connman_ipconfig_method method);
 static struct connman_ipconfig *create_ip6config(struct connman_service 
*service,
                int index);
+static void dns_changed(struct connman_service *service);
 
 struct find_data {
        const char *path;
@@ -922,6 +924,24 @@ static bool is_connected_state(const struct 
connman_service *service,
        return false;
 }
 
+static bool is_idle(struct connman_service *service)
+{
+       switch (service->state) {
+       case CONNMAN_SERVICE_STATE_IDLE:
+       case CONNMAN_SERVICE_STATE_DISCONNECT:
+       case CONNMAN_SERVICE_STATE_FAILURE:
+               return true;
+       case CONNMAN_SERVICE_STATE_UNKNOWN:
+       case CONNMAN_SERVICE_STATE_ASSOCIATION:
+       case CONNMAN_SERVICE_STATE_CONFIGURATION:
+       case CONNMAN_SERVICE_STATE_READY:
+       case CONNMAN_SERVICE_STATE_ONLINE:
+               break;
+       }
+
+       return false;
+}
+
 static bool is_connecting(struct connman_service *service)
 {
        return is_connecting_state(service, service->state);
@@ -932,6 +952,29 @@ 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;
+
+       DBG("service %p", service);
+
+       service->nameservers_timeout = 0;
+       if ((is_idle(service) && !service->nameservers) ||
+                       is_connected(service))
+               dns_changed(service);
+
+       return FALSE;
+}
+
+static void nameservers_changed(struct connman_service *service)
+{
+       if (!service->nameservers_timeout)
+               service->nameservers_timeout = g_timeout_add_seconds(0,
+                                                       nameservers_changed_cb,
+                                                       service);
+}
+
 static bool nameserver_available(struct connman_service *service,
                                enum connman_ipconfig_type type,
                                const char *ns)
@@ -1139,6 +1182,8 @@ int __connman_service_nameserver_append(struct 
connman_service *service,
                nameserver_add(service, CONNMAN_IPCONFIG_TYPE_ALL, nameserver);
        }
 
+       nameservers_changed(service);
+
        searchdomain_add_all(service);
 
        return 0;
@@ -1207,6 +1252,8 @@ set_servers:
                                nameserver);
        }
 
+       nameservers_changed(service);
+
        return 0;
 }
 
@@ -4500,6 +4547,11 @@ static void service_free(gpointer user_data)
 
        reply_pending(service, ENOENT);
 
+       if (service->nameservers_timeout) {
+               g_source_remove(service->nameservers_timeout);
+               dns_changed(service);
+       }
+
        __connman_notifier_service_remove(service);
        service_schedule_removed(service);
 
@@ -5440,7 +5492,7 @@ static int service_indicate_state(struct connman_service 
*service)
                g_get_current_time(&service->modified);
                service_save(service);
 
-               dns_changed(service);
+               nameservers_changed(service);
                domain_changed(service);
                proxy_changed(service);
 
@@ -5481,7 +5533,7 @@ static int service_indicate_state(struct connman_service 
*service)
 
                __connman_wpad_stop(service);
 
-               dns_changed(service);
+               nameservers_changed(service);
                domain_changed(service);
                proxy_changed(service);
 
-- 
2.9.3



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

Message: 5
Date: Fri, 14 Oct 2016 19:15:36 +0200
From: Fabio Emiliani <fabio.emili...@artgroup-spa.com>
To: connman@lists.01.org
Subject: How to stop connection procedure?
Message-ID: <9c647f85-7d49-0743-37ac-189ea11b8...@artgroup-spa.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Dear all,

I'm developing a Qt-based application using libconnman-qt and connman. 
Please consider the following use case:

- the user starts the connection to a network
- the connection starts
- a passphrase is required
- the user doesn't want to connect anymore

Actually after the requestConnect() I've got back a 
serviceConnectionStarted() signal, then I receive a 
userInputRequested(QString,QVariantMap) (passphrase request).

If I try to execute a requestDisconnect() I see in the logs:
Reply from service.connect():  "Invalid arguments"

This makes sense, I can't disconnect from a network I'm not connected 
in, the connection is "In progress", connman is still waiting for a 
password...

  * How can I abort the connection procedure? Which is the
    libconnman-qt/connman API to use?
  * How can I get the status of the connection procedure (e.g.
    "connecting", "waiting for a passphrase", "connected")?

Thanks in advance for your time

Regards,
Fabio Emiliani

-- 

*Fabio Emiliani*

*/Software Engineer/*

/Ph. +39 075 8298 532/

/fabioemili...@artgroup-spa.com/ <mailto:fabioemili...@artgroup-spa.com>

DISCLAIMER
This email and any attachment may contain confidential information. If 
you are not the intended recipient you are not authorised to copy or 
disclose all or any part of it without the prior written consent of ART SpA.

/ART SpA ? Step Forward With US - //www.artgroup-spa.com/logo_ART_firma-1//

/Ph. +39 075 8298 501 ? Fax +39 075 8298 525 /

P*Please consider our environment  before printing this e-mail***

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.01.org/pipermail/connman/attachments/20161014/fdb515ba/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo_ART_firma-1.jpg
Type: image/jpeg
Size: 16420 bytes
Desc: not available
URL: 
<http://lists.01.org/pipermail/connman/attachments/20161014/fdb515ba/attachment.jpg>

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

Subject: Digest Footer

_______________________________________________
connman mailing list
connman@lists.01.org
https://lists.01.org/mailman/listinfo/connman


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

End of connman Digest, Vol 12, Issue 18
***************************************

Reply via email to