Remove use of AI_ADDRCONFIG.

Closes #869, #901.

Thanks to Alex Richman.

Signed-off-by: Roger A. Light <roger@atchoo.org>
pull/1600/head
Roger A. Light 7 years ago
parent db2feac172
commit eb106907a6

@ -6,6 +6,8 @@ Broker:
Closes #900. Closes #900.
- Print more OpenSSL errors when loading certificates/keys fail. - Print more OpenSSL errors when loading certificates/keys fail.
- Use AF_UNSPEC etc. instead of PF_UNSPEC to comply with POSIX. Closes #863. - Use AF_UNSPEC etc. instead of PF_UNSPEC to comply with POSIX. Closes #863.
- Remove use of AI_ADDRCONFIG, which means the broker can be used on systems
where only the loopback interface is defined. Closes #869, Closes #901.
1.5 - 20180502 1.5 - 20180502

@ -46,9 +46,6 @@ Contributors:
#endif #endif
#ifdef __QNX__ #ifdef __QNX__
#ifndef AI_ADDRCONFIG
#define AI_ADDRCONFIG 0
#endif
#include <net/netbyte.h> #include <net/netbyte.h>
#include <netinet/in.h> #include <netinet/in.h>
#endif #endif
@ -311,7 +308,6 @@ int net__try_connect(struct mosquitto *mosq, const char *host, uint16_t port, mo
*sock = INVALID_SOCKET; *sock = INVALID_SOCKET;
memset(&hints, 0, sizeof(struct addrinfo)); memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_UNSPEC; hints.ai_family = AF_UNSPEC;
hints.ai_flags = AI_ADDRCONFIG;
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;
s = getaddrinfo(host, NULL, &hints, &ainfo); s = getaddrinfo(host, NULL, &hints, &ainfo);

@ -115,7 +115,6 @@ static int conf__attempt_resolve(const char *host, const char *text, int log, co
memset(&gai_hints, 0, sizeof(struct addrinfo)); memset(&gai_hints, 0, sizeof(struct addrinfo));
gai_hints.ai_family = AF_UNSPEC; gai_hints.ai_family = AF_UNSPEC;
gai_hints.ai_flags = AI_ADDRCONFIG;
gai_hints.ai_socktype = SOCK_STREAM; gai_hints.ai_socktype = SOCK_STREAM;
gai_res = NULL; gai_res = NULL;
rc = getaddrinfo(host, NULL, &gai_hints, &gai_res); rc = getaddrinfo(host, NULL, &gai_hints, &gai_res);

Loading…
Cancel
Save