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. [PATCH 2/2] service: Move code around to avoid declaring a
static function (Patrik Flykt)
2. [PATCH 0/2] Set search domains on connect (Patrik Flykt)
3. [PATCH 1/2] service: Set search domains when connected
(Patrik Flykt)
4. Re: [PATCH 1/2] service: Set search domains when connected
(Mike Purvis)
----------------------------------------------------------------------
Message: 1
Date: Thu, 26 Nov 2015 16:09:24 +0200
From: Patrik Flykt <[email protected]>
To: [email protected]
Subject: [PATCH 2/2] service: Move code around to avoid declaring a
static function
Message-ID:
<[email protected]>
No functional changes are introduced.
---
src/service.c | 102 +++++++++++++++++++++++++++++-----------------------------
1 file changed, 51 insertions(+), 51 deletions(-)
diff --git a/src/service.c b/src/service.c
index c79fca0..abf0899 100644
--- a/src/service.c
+++ b/src/service.c
@@ -134,8 +134,6 @@ static struct connman_ipconfig *create_ip4config(struct
connman_service *service
static struct connman_ipconfig *create_ip6config(struct connman_service
*service,
int index);
-static int searchdomain_add_all(struct connman_service *service);
-
struct find_data {
const char *path;
struct connman_service *service;
@@ -942,6 +940,56 @@ static bool nameserver_available(struct connman_service
*service,
return false;
}
+static int searchdomain_add_all(struct connman_service *service)
+{
+ int index, i = 0;
+
+ if (!is_connected(service))
+ return -ENOTCONN;
+
+ index = __connman_service_get_index(service);
+ if (index < 0)
+ return -ENXIO;
+
+ if (service->domains) {
+ while (service->domains[i]) {
+ connman_resolver_append(index, service->domains[i],
+ NULL);
+ i++;
+ }
+
+ return 0;
+ }
+
+ if (service->domainname)
+ connman_resolver_append(index, service->domainname, NULL);
+
+ return 0;
+
+}
+
+static int searchdomain_remove_all(struct connman_service *service)
+{
+ int index, i = 0;
+
+ if (!is_connected(service))
+ return -ENOTCONN;
+
+ index = __connman_service_get_index(service);
+ if (index < 0)
+ return -ENXIO;
+
+ while (service->domains && service->domains[i]) {
+ connman_resolver_remove(index, service->domains[i], NULL);
+ i++;
+ }
+
+ if (service->domainname)
+ connman_resolver_remove(index, service->domainname, NULL);
+
+ return 0;
+}
+
static int nameserver_add(struct connman_service *service,
enum connman_ipconfig_type type,
const char *nameserver)
@@ -1020,55 +1068,7 @@ static int nameserver_remove_all(struct connman_service
*service,
i++;
}
- return 0;
-}
-
-static int searchdomain_add_all(struct connman_service *service)
-{
- int index, i = 0;
-
- if (!is_connected(service))
- return -ENOTCONN;
-
- index = __connman_service_get_index(service);
- if (index < 0)
- return -ENXIO;
-
- if (service->domains) {
- while (service->domains[i]) {
- connman_resolver_append(index, service->domains[i],
- NULL);
- i++;
- }
-
- return 0;
- }
-
- if (service->domainname)
- connman_resolver_append(index, service->domainname, NULL);
-
- return 0;
-
-}
-
-static int searchdomain_remove_all(struct connman_service *service)
-{
- int index, i = 0;
-
- if (!is_connected(service))
- return -ENOTCONN;
-
- index = __connman_service_get_index(service);
- if (index < 0)
- return -ENXIO;
-
- while (service->domains && service->domains[i]) {
- connman_resolver_remove(index, service->domains[i], NULL);
- i++;
- }
-
- if (service->domainname)
- connman_resolver_remove(index, service->domainname, NULL);
+ searchdomain_remove_all(service);
return 0;
}
--
2.1.4
------------------------------
Message: 2
Date: Thu, 26 Nov 2015 16:09:22 +0200
From: Patrik Flykt <[email protected]>
To: [email protected]
Subject: [PATCH 0/2] Set search domains on connect
Message-ID:
<[email protected]>
Hi,
Patch 1/2 obsoletes the previous patch called "service: Set search domains
regardless of connected state". Instead, ensure that search domains are
added at least once after a successful connection. The previously committed
patches ensure that search domains are updated properly when new nameservers
are added.
Patch 2/2 trivially moves code around to get rid of a somewhat useless
function declaration.
Cheers,
Patrik
Patrik Flykt (2):
service: Set search domains when connected
service: Move code around to avoid declaring a static function
src/service.c | 106 ++++++++++++++++++++++++++++++----------------------------
1 file changed, 55 insertions(+), 51 deletions(-)
--
2.1.4
------------------------------
Message: 3
Date: Thu, 26 Nov 2015 16:09:23 +0200
From: Patrik Flykt <[email protected]>
To: [email protected]
Subject: [PATCH 1/2] service: Set search domains when connected
Message-ID:
<[email protected]>
Name servers have their own internal check and are added for either IPv4
or IPv6 before the service state is computed. As search domains apply to
both IPv4 and IPv6 name server lookups, the search domains are added when
the service is connected using either IPv4 or IPv6.
The previous changes ensure that search domains are properly added to
newly created nameservers. This change properly adds search domains the
first time the service gets to a connected state.
This also fixes missing search domains in resolv.conf when not using
DNS proxying as reported by Mike Purvis.
---
src/service.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/service.c b/src/service.c
index e3317dd..c79fca0 100644
--- a/src/service.c
+++ b/src/service.c
@@ -5320,6 +5320,10 @@ static int service_indicate_state(struct connman_service
*service)
service->state = new_state;
state_changed(service);
+ if (!is_connected_state(service, old_state) &&
+ is_connected_state(service, new_state))
+ searchdomain_add_all(service);
+
switch(new_state) {
case CONNMAN_SERVICE_STATE_UNKNOWN:
--
2.1.4
------------------------------
Message: 4
Date: Thu, 26 Nov 2015 10:18:06 -0500
From: Mike Purvis <[email protected]>
To: Patrik Flykt <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 1/2] service: Set search domains when connected
Message-ID:
<CACsJT9Oq=pqssh4bf3a202v2t4s1ecrmhmj2rdbc11dmbge...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Cool, thanks for addressing this? will try it out in v1.31.
On 26 November 2015 at 09:09, Patrik Flykt <[email protected]>
wrote:
> Name servers have their own internal check and are added for either IPv4
> or IPv6 before the service state is computed. As search domains apply to
> both IPv4 and IPv6 name server lookups, the search domains are added when
> the service is connected using either IPv4 or IPv6.
>
> The previous changes ensure that search domains are properly added to
> newly created nameservers. This change properly adds search domains the
> first time the service gets to a connected state.
>
> This also fixes missing search domains in resolv.conf when not using
> DNS proxying as reported by Mike Purvis.
> ---
> src/service.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/src/service.c b/src/service.c
> index e3317dd..c79fca0 100644
> --- a/src/service.c
> +++ b/src/service.c
> @@ -5320,6 +5320,10 @@ static int service_indicate_state(struct
> connman_service *service)
> service->state = new_state;
> state_changed(service);
>
> + if (!is_connected_state(service, old_state) &&
> + is_connected_state(service, new_state))
> + searchdomain_add_all(service);
> +
> switch(new_state) {
> case CONNMAN_SERVICE_STATE_UNKNOWN:
>
> --
> 2.1.4
>
> _______________________________________________
> connman mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/connman
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.01.org/pipermail/connman/attachments/20151126/492592a1/attachment-0001.html>
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 1, Issue 8
*************************************