forked from pool/c-ares
4c1bcc5dd1
Needed to fix envoy-proxy - Add upstream patches with the ares_getaddrinfo function: * 0001-Add-initial-implementation-for-ares_getaddrinfo-112.patch * 0002-Remaining-queries-counter-fix-additional-unit-tests-.patch * 0003-Bugfix-for-ares_getaddrinfo-and-additional-unit-test.patch * 0004-Add-ares__sortaddrinfo-to-support-getaddrinfo-sorted.patch * 0005-getaddrinfo-avoid-infinite-loop-in-case-of-NXDOMAIN-.patch * 0006-getaddrinfo-callback-must-be-called-on-bad-domain-24.patch * 0007-getaddrinfo-enhancements-257.patch * 0008-Add-missing-limits.h-include-from-ares_getaddrinfo.c.patch * 0009-Increase-portability-of-ares-test-mock-ai.cc-235.patch - Add a patch which disables test failing on OBS (but passing in local environment): * 0010-Disable-failing-test.patch OBS-URL: https://build.opensuse.org/request/show/742197 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/c-ares?expand=0&rev=9
71 lines
2.2 KiB
Diff
71 lines
2.2 KiB
Diff
From d50b452fcbf34bddac3e59dfd53ff7d93fad7794 Mon Sep 17 00:00:00 2001
|
|
From: Christian Ammer <chrie.ammer@gmail.com>
|
|
Date: Mon, 3 Dec 2018 01:08:49 +0100
|
|
Subject: [PATCH 09/10] Increase portability of `ares-test-mock-ai.cc` (#235)
|
|
|
|
* using portable ares_inet_pton and updated includes in ares-test-mock-ai
|
|
* forgot to remove deleted ares-test-ai.cc in Makefile.inc
|
|
|
|
Fix By: Christian Ammer (@ChristianAmmer)
|
|
---
|
|
test/Makefile.inc | 1 -
|
|
test/ares-test-ai.cc | 0
|
|
test/ares-test-mock-ai.cc | 9 ++++-----
|
|
3 files changed, 4 insertions(+), 6 deletions(-)
|
|
delete mode 100644 test/ares-test-ai.cc
|
|
|
|
diff --git a/test/Makefile.inc b/test/Makefile.inc
|
|
index 7952b4c..3c68d7c 100644
|
|
--- a/test/Makefile.inc
|
|
+++ b/test/Makefile.inc
|
|
@@ -1,7 +1,6 @@
|
|
TESTSOURCES = ares-test-main.cc \
|
|
ares-test-init.cc \
|
|
ares-test.cc \
|
|
- ares-test-ai.cc \
|
|
ares-test-ns.cc \
|
|
ares-test-parse.cc \
|
|
ares-test-parse-a.cc \
|
|
diff --git a/test/ares-test-ai.cc b/test/ares-test-ai.cc
|
|
deleted file mode 100644
|
|
index e69de29..0000000
|
|
diff --git a/test/ares-test-mock-ai.cc b/test/ares-test-mock-ai.cc
|
|
index d22b9a3..d0df867 100644
|
|
--- a/test/ares-test-mock-ai.cc
|
|
+++ b/test/ares-test-mock-ai.cc
|
|
@@ -1,11 +1,10 @@
|
|
#include "ares-test-ai.h"
|
|
#include "dns-proto.h"
|
|
|
|
-#ifdef HAVE_NETDB_H
|
|
-#include <netdb.h>
|
|
+#ifdef HAVE_NETINET_IN_H
|
|
+#include <netinet/in.h>
|
|
#endif
|
|
|
|
-#include <arpa/inet.h>
|
|
#include <sstream>
|
|
#include <vector>
|
|
|
|
@@ -28,7 +27,7 @@ MATCHER_P(IncludesV4Address, address, "") {
|
|
if(!arg)
|
|
return false;
|
|
in_addr addressnum = {};
|
|
- if (!inet_pton(AF_INET, address, &addressnum))
|
|
+ if (!ares_inet_pton(AF_INET, address, &addressnum))
|
|
return false; // wrong number format?
|
|
for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next) {
|
|
if (ai->ai_family != AF_INET)
|
|
@@ -44,7 +43,7 @@ MATCHER_P(IncludesV6Address, address, "") {
|
|
if(!arg)
|
|
return false;
|
|
in6_addr addressnum = {};
|
|
- if (!inet_pton(AF_INET6, address, &addressnum)) {
|
|
+ if (!ares_inet_pton(AF_INET6, address, &addressnum)) {
|
|
return false; // wrong number format?
|
|
}
|
|
for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next) {
|
|
--
|
|
2.16.4
|
|
|