Replace addrinfo with IPSockAddr to store dns addresses
The struct addrinfo is designed to store multi-addresses and it
might cause memory leaks if improperly used. IPSockAddr is safer
and is extensible. It also helps simplify the struct resolv_cache_info,
where nameservers and nscount is no longer necessary.
Bug: 130686826
Test: atest --include-subdirs packages/modules/DnsResolver
Change-Id: I3243f2f79c94ebe3d03503914d25b5863da20c09
diff --git a/res_init.cpp b/res_init.cpp
index a1619d9..181a778 100644
--- a/res_init.cpp
+++ b/res_init.cpp
@@ -111,7 +111,7 @@
}
// The following dummy initialization is probably useless because
- // it's overwritten later by _resolv_populate_res_for_net().
+ // it's overwritten later by resolv_populate_res_for_net().
// TODO: check if it's safe to remove.
const sockaddr_union u{
.sin.sin_addr.s_addr = INADDR_ANY,