Use getaddrinfo_retro even for dependencies

This commit is contained in:
twinaphex 2017-05-20 14:22:30 +02:00
parent 5f75ce3f12
commit bbef084955
3 changed files with 8 additions and 3 deletions

View File

@ -133,6 +133,7 @@ mg_static_assert(sizeof(void *) >= sizeof(int), "data type size check");
#include <assert.h>
#include <compat/strl.h>
#include <net/net_compat.h>
/* clock_gettime is not implemented on OSX */
int clock_gettime(int clk_id, struct timespec *t);
@ -5727,7 +5728,7 @@ mg_inet_pton(int af, const char *src, void *dst, size_t dstlen)
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = af;
if (getaddrinfo(src, NULL, &hints, &res) != 0) {
if (getaddrinfo_retro(src, NULL, &hints, &res) != 0) {
/* bad src string or bad address family */
return 0;
}

View File

@ -53,6 +53,8 @@
#define herror(A) printf("%s\n", A)
#endif
#include <net/net_compat.h>
#include "connecthostport.h"
#ifndef MAXHOSTNAMELEN
@ -173,7 +175,7 @@ int connecthostport(const char * host, unsigned short port,
strncpy(tmp_host, host, MAXHOSTNAMELEN);
}
tmp_host[MAXHOSTNAMELEN] = '\0';
n = getaddrinfo(tmp_host, port_str, &hints, &ai);
n = getaddrinfo_retro(tmp_host, port_str, &hints, &ai);
if(n != 0)
{
#ifdef _WIN32

View File

@ -98,6 +98,8 @@ struct ip_mreqn
#include "miniupnpc.h"
#include "receivedata.h"
#include <net/net_compat.h>
#if !(defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__))
#include "codelength.h"
@ -757,7 +759,7 @@ ssdpDiscoverDevices(const char * const deviceTypes[],
hints.ai_family = AF_UNSPEC; /* AF_INET6 or AF_INET */
hints.ai_socktype = SOCK_DGRAM;
/*hints.ai_flags = */
if ((rv = getaddrinfo(ipv6
if ((rv = getaddrinfo_retro(ipv6
? (linklocal ? UPNP_MCAST_LL_ADDR : UPNP_MCAST_SL_ADDR)
: UPNP_MCAST_ADDR,
XSTR(SSDP_PORT), &hints, &servinfo)) != 0) {