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 04/11] src: add missing include (Ross Burton)
   2. [PATCH 05/11] gweb: add missing include of stdio.h (Ross Burton)
   3. [PATCH 06/11] resolve: musl does not implement res_ninit
      (Ross Burton)
   4. [PATCH 07/11] tools: fix includes for musl (Ross Burton)
   5. [PATCH 08/11] tools: include poll.h instead of sys/poll.h
      (Ross Burton)
   6. [PATCH 09/11] plugins: add sys/types.h for caddr_t (Ross Burton)
   7. [PATCH 10/11] plugins: fix includes for musl (Ross Burton)
   8. [PATCH 11/11] tools: add missing include of stdio.h (Ross Burton)


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

Message: 1
Date: Wed,  3 Oct 2018 11:51:32 +0100
From: Ross Burton <[email protected]>
To: [email protected]
Subject: [PATCH 04/11] src: add missing include
Message-ID: <[email protected]>

sighander_t is used, so include signal.h.
---
 src/log.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/log.c b/src/log.c
index dd48a45c..554b046b 100644
--- a/src/log.c
+++ b/src/log.c
@@ -30,6 +30,7 @@
 #include <string.h>
 #include <syslog.h>
 #include <dlfcn.h>
+#include <signal.h>
 
 #include "connman.h"
 
-- 
2.11.0



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

Message: 2
Date: Wed,  3 Oct 2018 11:51:33 +0100
From: Ross Burton <[email protected]>
To: [email protected]
Subject: [PATCH 05/11] gweb: add missing include of stdio.h
Message-ID: <[email protected]>

gresolv.c uses snprintf() so include stdio.h.

Signed-off-by: Ross Burton <[email protected]>
---
 gweb/gresolv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index 81c79b6c..38a554e0 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -28,6 +28,7 @@
 #include <stdarg.h>
 #include <string.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <resolv.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-- 
2.11.0



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

Message: 3
Date: Wed,  3 Oct 2018 11:51:34 +0100
From: Ross Burton <[email protected]>
To: [email protected]
Cc: Khem Raj <[email protected]>
Subject: [PATCH 06/11] resolve: musl does not implement res_ninit
Message-ID: <[email protected]>

From: Khem Raj <[email protected]>

ported from
http://git.alpinelinux.org/cgit/aports/plain/testing/connman/libresolv.patch

Upstream-Status: Pending

Signed-off-by: Khem Raj <[email protected]>
Signed-off-by: Ross Burton <[email protected]>
---
 gweb/gresolv.c | 34 +++++++++++++---------------------
 1 file changed, 13 insertions(+), 21 deletions(-)

diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index 38a554e0..a9e87402 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -36,6 +36,7 @@
 #include <arpa/inet.h>
 #include <arpa/nameser.h>
 #include <net/if.h>
+#include <ctype.h>
 
 #include "gresolv.h"
 
@@ -877,8 +878,6 @@ GResolv *g_resolv_new(int index)
        resolv->index = index;
        resolv->nameserver_list = NULL;
 
-       res_ninit(&resolv->res);
-
        return resolv;
 }
 
@@ -918,8 +917,6 @@ void g_resolv_unref(GResolv *resolv)
 
        flush_nameservers(resolv);
 
-       res_nclose(&resolv->res);
-
        g_free(resolv);
 }
 
@@ -1022,24 +1019,19 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const 
char *hostname,
        debug(resolv, "hostname %s", hostname);
 
        if (!resolv->nameserver_list) {
-               int i;
-
-               for (i = 0; i < resolv->res.nscount; i++) {
-                       char buf[100];
-                       int family = resolv->res.nsaddr_list[i].sin_family;
-                       void *sa_addr = &resolv->res.nsaddr_list[i].sin_addr;
-
-                       if (family != AF_INET &&
-                                       resolv->res._u._ext.nsaddrs[i]) {
-                               family = AF_INET6;
-                               sa_addr = 
&resolv->res._u._ext.nsaddrs[i]->sin6_addr;
+               FILE *f = fopen("/etc/resolv.conf", "r");
+               if (f) {
+                       char line[256], *s;
+                       int i;
+                       while (fgets(line, sizeof(line), f)) {
+                               if (strncmp(line, "nameserver", 10) || 
!isspace(line[10]))
+                                       continue;
+                               for (s = &line[11]; isspace(s[0]); s++);
+                               for (i = 0; s[i] && !isspace(s[i]); i++);
+                               s[i] = 0;
+                               g_resolv_add_nameserver(resolv, s, 53, 0);
                        }
-
-                       if (family != AF_INET && family != AF_INET6)
-                               continue;
-
-                       if (inet_ntop(family, sa_addr, buf, sizeof(buf)))
-                               g_resolv_add_nameserver(resolv, buf, 53, 0);
+                       fclose(f);
                }
 
                if (!resolv->nameserver_list)
-- 
2.11.0



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

Message: 4
Date: Wed,  3 Oct 2018 11:51:35 +0100
From: Ross Burton <[email protected]>
To: [email protected]
Subject: [PATCH 07/11] tools: fix includes for musl
Message-ID: <[email protected]>

musl causes redefinition errors when pieces of the networking headers are
included, so remove the redundant includes.

Signed-off-by: Ross Burton <[email protected]>
---
 tools/dhcp-test.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/dhcp-test.c b/tools/dhcp-test.c
index fa27516d..a6c3e993 100644
--- a/tools/dhcp-test.c
+++ b/tools/dhcp-test.c
@@ -33,7 +33,6 @@
 #include <arpa/inet.h>
 #include <net/route.h>
 #include <net/ethernet.h>
-#include <linux/if_arp.h>
 
 #include <gdhcp/gdhcp.h>
 
-- 
2.11.0



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

Message: 5
Date: Wed,  3 Oct 2018 11:51:36 +0100
From: Ross Burton <[email protected]>
To: [email protected]
Subject: [PATCH 08/11] tools: include poll.h instead of sys/poll.h
Message-ID: <[email protected]>

musl warns when sys/foo.h is included when just foo.h should be included.

Signed-off-by: Ross Burton <[email protected]>
---
 tools/private-network-test.c | 2 +-
 tools/tap-test.c             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/private-network-test.c b/tools/private-network-test.c
index 3dd115ba..2828bb30 100644
--- a/tools/private-network-test.c
+++ b/tools/private-network-test.c
@@ -32,7 +32,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <signal.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/signalfd.h>
 #include <unistd.h>
 
diff --git a/tools/tap-test.c b/tools/tap-test.c
index 57917f51..cb3ee622 100644
--- a/tools/tap-test.c
+++ b/tools/tap-test.c
@@ -28,7 +28,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <string.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/ioctl.h>
 
 #include <netinet/in.h>
-- 
2.11.0



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

Message: 6
Date: Wed,  3 Oct 2018 11:51:37 +0100
From: Ross Burton <[email protected]>
To: [email protected]
Subject: [PATCH 09/11] plugins: add sys/types.h for caddr_t
Message-ID: <[email protected]>

musl needs sys/types.h to get the caddr_t typedef.
---
 plugins/ethernet.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/ethernet.c b/plugins/ethernet.c
index 4b265621..b0395c83 100644
--- a/plugins/ethernet.c
+++ b/plugins/ethernet.c
@@ -27,6 +27,7 @@
 #include <net/if.h>
 #include <string.h>
 #include <sys/ioctl.h>
+#include <sys/types.h>
 #include <unistd.h>
 #include <stdio.h>
 
-- 
2.11.0



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

Message: 7
Date: Wed,  3 Oct 2018 11:51:38 +0100
From: Ross Burton <[email protected]>
To: [email protected]
Subject: [PATCH 10/11] plugins: fix includes for musl
Message-ID: <[email protected]>

musl causes redefinition errors when pieces of the networking headers are
included, so remove the redundant includes.

Signed-off-by: Ross Burton <[email protected]>
---
 plugins/wifi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index b92fc640..e437daeb 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -30,9 +30,8 @@
 #include <string.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
-#include <linux/if_arp.h>
-#include <linux/wireless.h>
 #include <net/ethernet.h>
+#include <linux/wireless.h>
 
 #ifndef IFF_LOWER_UP
 #define IFF_LOWER_UP   0x10000
-- 
2.11.0



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

Message: 8
Date: Wed,  3 Oct 2018 11:51:39 +0100
From: Ross Burton <[email protected]>
To: [email protected]
Subject: [PATCH 11/11] tools: add missing include of stdio.h
Message-ID: <[email protected]>

dnsproxy-test.c uses fprintf() so include stdio.h.

Signed-off-by: Ross Burton <[email protected]>
---
 tools/dnsproxy-test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/dnsproxy-test.c b/tools/dnsproxy-test.c
index 551cae91..371e2e23 100644
--- a/tools/dnsproxy-test.c
+++ b/tools/dnsproxy-test.c
@@ -24,6 +24,7 @@
 #endif
 
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-- 
2.11.0



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

Subject: Digest Footer

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


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

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

Reply via email to