Commit 4e23b499 authored by Ondřej Zajíček's avatar Ondřej Zajíček

RPKI: Fix handling of IPv6 cache addresses

The old code used just sizeof(struct sockaddr) bytes of IP address.
parent b000a942
Pipeline #54404 passed with stages
in 10 minutes and 11 seconds
......@@ -26,7 +26,6 @@
static ip_addr
rpki_hostname_autoresolv(const char *host)
{
ip_addr addr = {};
struct addrinfo *res;
struct addrinfo hints = {
.ai_family = AF_UNSPEC,
......@@ -44,12 +43,10 @@ rpki_hostname_autoresolv(const char *host)
return IPA_NONE;
}
sockaddr sa = {
.sa = *res->ai_addr,
};
ip_addr addr = IPA_NONE;
uint unused;
sockaddr_read(&sa, res->ai_family, &addr, NULL, &unused);
sockaddr_read((sockaddr *) res->ai_addr, res->ai_family, &addr, NULL, &unused);
freeaddrinfo(res);
return addr;
......
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