mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
tests: improved ipv6-prefix
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
@@ -23,18 +23,17 @@
|
||||
#include "../src/ip-util.h"
|
||||
#include "../src/ip-util.c"
|
||||
|
||||
static char* my_ipv6_prefix_to_mask(const char *str, unsigned prefix)
|
||||
static char* my_ipv6_prefix_to_mask(char str[MAX_IP_STR], unsigned prefix)
|
||||
{
|
||||
struct in6_addr in;
|
||||
static char out[64];
|
||||
|
||||
if (ipv6_prefix_to_mask(&in, prefix) == 0)
|
||||
return NULL;
|
||||
|
||||
if (inet_ntop(AF_INET6, &in, out, sizeof(out)) == NULL)
|
||||
if (inet_ntop(AF_INET6, &in, str, MAX_IP_STR) == NULL)
|
||||
return NULL;
|
||||
|
||||
return out;
|
||||
return str;
|
||||
}
|
||||
|
||||
int main()
|
||||
|
||||
Reference in New Issue
Block a user