Commit 6ac8aa90 authored by Simon Morlat's avatar Simon Morlat

fix ipv6 resolver test on windows

parent a97a3b32
......@@ -79,6 +79,11 @@
#include <iphlpapi.h>
#pragma comment(lib, "IPHLPAPI.lib")
#endif
#ifndef IPV6_V6ONLY
#define IPV6_V6ONLY 27
#endif
#else
#include <sys/types.h> /* FD_SETSIZE socklen_t */
#include <sys/select.h> /* FD_ZERO FD_SET fd_set select(2) */
......@@ -5709,7 +5714,8 @@ static void dns_so_destroy(struct dns_socket *);
static struct dns_socket *dns_so_init(struct dns_socket *so, const struct sockaddr *local, int type, const struct dns_options *opts, int *error) {
static struct dns_socket so_initializer;
static DNSBool initialized = 0;
int value=0;
if (!initialized) {
memset(&so_initializer, 0, sizeof so_initializer);
so_initializer.opts.closefd.arg = 0;
......@@ -5731,7 +5737,8 @@ static struct dns_socket *dns_so_init(struct dns_socket *so, const struct sockad
if (-1 == (so->udp = dns_socket((struct sockaddr *)&so->local, SOCK_DGRAM, error)))
goto error;
value=0;
setsockopt(so->udp, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&value, sizeof(value));
dns_k_permutor_init(&so->qids, 1, 65535);
return so;
......
......@@ -262,7 +262,7 @@ int belle_sip_tester_run_tests(const char *suite_name, const char *test_name) {
if (test_name) {
CU_pTest test=CU_get_test_by_name(test_name, suite);
if (test==NULL){
fprintf(stderr,"There is no test named '%s'",suite_name);
fprintf(stderr,"There is no test named '%s'",test_name);
exit(-1);
}
CU_run_test(suite, test);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment