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. connam 1.31, and wpa_supplicant (Mauro Ziliani)
   2. [PATCH] dnsproxy: Remove DNS servers of disconnected/idle
      service (Jussi Laakkonen)


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

Message: 1
Date: Mon, 6 May 2019 15:32:16 +0200
From: Mauro Ziliani <[email protected]>
To: [email protected]
Subject: connam 1.31, and wpa_supplicant
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-15

Hi all.
My name's Mauro and I'm working on a project with Yocto Jethro/Krogoth,
imx6dlsabresd board,? dongle usb Edimax EW7811un, Qt5, connamd.

Only the first time i plugin the dongle and I try to init the wifi, I
get the message


May? 6 15:15:29 C50000000000 wpa_supplicant: Libgcrypt warning: missing
initialization - please fix the application


Then next times no message are written.



Why this message was emitted?


Best regards,

? MZ



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

Message: 2
Date: Mon,  6 May 2019 18:35:12 +0300
From: Jussi Laakkonen <[email protected]>
To: [email protected]
Subject: [PATCH] dnsproxy: Remove DNS servers of disconnected/idle
        service
Message-ID: <[email protected]>

This addresses the issue of having changing interface indexes with,
e.g., VPNs that causes the DNS servers to accumulate in the list when
the index of a VPN changes but the service and DNS server addresses
remain the same. Reason for this is how find_server() behaves when
adding new DNS servers.

VPNs can change interface index more rapidly as they can be connected
when the previous VPN connection is still disconnecting or cleaning up
and the previous interface is up so new interface for the new VPN
connection is brought up. The service, however, is still the same and so
are the DNS servers.

When such thing happens and the DNS servers do not change,
"src/dnsproxy.c:ns_resolv() Cannot send message to server 8.8.8.8 sock
47 protocol 17 (Invalid argument/22)" is given as error. If there are
no new DNS servers set by the new VPN connection DNS does not work until
there is some other change triggering. Reason for this is that connected
UDP sockets are used and when the error happens "netstat -un" displays
bunch of connections with IP different to what is currently used.

By adding this service state listener enabling removal of the DNS
servers of the disconnecting/idle service the issue described is
eliminated. Removal of the DNS servers is done using the index of the
disconnecting service, allowing to remove the DNS servers of a service
that has begun its disconnection process. As a result the DNS server
list keeps clean and when the VPN is re-connected with new interface the
DNS servers are added again but they have correct interfaces set and
further DNS requests can be sent.
---
 src/dnsproxy.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index 2dc73408..bd1c0c7e 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -2912,10 +2912,46 @@ static void dnsproxy_default_changed(struct 
connman_service *service)
        cache_refresh();
 }
 
+static void dnsproxy_service_state_changed(struct connman_service *service,
+                       enum connman_service_state state)
+{
+       GSList *list;
+       int index;
+
+       switch (state) {
+       case CONNMAN_SERVICE_STATE_DISCONNECT:
+       case CONNMAN_SERVICE_STATE_IDLE:
+               break;
+       case CONNMAN_SERVICE_STATE_ASSOCIATION:
+       case CONNMAN_SERVICE_STATE_CONFIGURATION:
+       case CONNMAN_SERVICE_STATE_FAILURE:
+       case CONNMAN_SERVICE_STATE_ONLINE:
+       case CONNMAN_SERVICE_STATE_READY:
+       case CONNMAN_SERVICE_STATE_UNKNOWN:
+               return;
+       }
+
+       index = __connman_service_get_index(service);
+       list = server_list;
+
+       while (list) {
+               struct server_data *data = list->data;
+
+               /* Get next before the list is changed by destroy_server() */
+               list = list->next;
+
+               if (data->index == index) {
+                       DBG("removing server data of index %d", index);
+                       destroy_server(data);
+               }
+       }
+}
+
 static const struct connman_notifier dnsproxy_notifier = {
        .name                   = "dnsproxy",
        .default_changed        = dnsproxy_default_changed,
        .offline_mode           = dnsproxy_offline_mode,
+       .service_state_changed  = dnsproxy_service_state_changed,
 };
 
 static const unsigned char opt_edns0_type[2] = { 0x00, 0x29 };
-- 
2.20.1



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

Subject: Digest Footer

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


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

End of connman Digest, Vol 43, Issue 7
**************************************

Reply via email to