When all the addresses were already iterated over, the dns_remote_curraddr() function asserts. So before calling it, dns_zone_getprimaryaddr() now checks the address list using the dns_remote_done() function. This also means that instead of returning 'isc_sockaddr_t' it now returns 'isc_result_t' and writes the primary's address into the provided pointer only when returning success.