parameter.prefer_ipv4 is implemented

This commit is contained in:
Sukchan Lee 2017-12-03 16:31:53 +09:00
parent f86839eb7b
commit 17b6a013b8
6 changed files with 91 additions and 8 deletions

View file

@ -1,5 +1,6 @@
#include "core_debug.h"
#include "core_thread.h"
#include "core_pkbuf.h"
#include "core_network.h"
@ -328,6 +329,18 @@ static void sock_test6(abts_case *tc, void *data)
rv = core_getaddrinfo(&paddr, AF_UNSPEC, NULL, PORT, 0);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = core_sortaddrinfo(&paddr, AF_INET6);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
ABTS_STR_EQUAL(tc, "::1", CORE_ADDR(paddr, buf));
ABTS_PTR_NOTNULL(tc, paddr->next);
ABTS_STR_EQUAL(tc, "127.0.0.1", CORE_ADDR(paddr->next, buf));
rv = core_sortaddrinfo(&paddr, AF_INET);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
ABTS_STR_EQUAL(tc, "127.0.0.1", CORE_ADDR(paddr, buf));
ABTS_PTR_NOTNULL(tc, paddr->next);
ABTS_STR_EQUAL(tc, "::1", CORE_ADDR(paddr->next, buf));
rv = core_freeaddrinfo(paddr);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
}