X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Fdns.c;h=9859e83658839600f42df07a7595575194a8f136;hb=d57d474fe88b3c9837f8516779c87f3a76f682f2;hp=27ab2d2a237984469a17f990392734c03d2a980c;hpb=a8aaded1487784bc9a6d4b1f2391eccdda8d5e1c;p=exim.git diff --git a/src/src/dns.c b/src/src/dns.c index 27ab2d2a2..9859e8365 100644 --- a/src/src/dns.c +++ b/src/src/dns.c @@ -1112,8 +1112,7 @@ return DNS_FAIL; * Get address(es) from DNS record * *************************************************/ -/* The record type is either T_A for an IPv4 address or T_AAAA (or T_A6 when -supported) for an IPv6 address. +/* The record type is either T_A for an IPv4 address or T_AAAA for an IPv6 address. Argument: dnsa the DNS answer block @@ -1145,8 +1144,11 @@ else { if (rr->data + 16 <= dnsa_lim) { + struct in6_addr in6; + int i; + for (i = 0; i < 16; i++) in6.__in6_u.__u6_addr8[i] = rr->data[i]; yield = store_get(sizeof(dns_address) + 50); - inet_ntop(AF_INET6, US rr->data, CS yield->address, 50); + inet_ntop(AF_INET6, &in6, CS yield->address, 50); yield->next = NULL; } }