-/* $OpenBSD: res_init.c,v 1.2 2013/05/27 17:31:01 eric Exp $ */
+/* $OpenBSD: res_init.c,v 1.3 2014/01/15 02:25:34 sthen Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
{
_THREAD_PRIVATE_MUTEX(init);
struct asr_ctx *ac;
+ int i;
ac = asr_use_resolver(NULL);
strlcpy(_res.lookups, ac->ac_db, sizeof(_res.lookups));
_res.nscount = ac->ac_nscount;
+ for (i = 0; i < ac->ac_nscount; i++) {
+ memcpy(&_res.nsaddr_list[i], ac->ac_ns[i],
+ ac->ac_ns[i]->sa_len);
+ }
_res.options |= RES_INIT;
}
_THREAD_PRIVATE_MUTEX_UNLOCK(init);