diff --git a/libc/netbsd/resolv/res_cache.c b/libc/netbsd/resolv/res_cache.c index 838e084e2..915fdf056 100644 --- a/libc/netbsd/resolv/res_cache.c +++ b/libc/netbsd/resolv/res_cache.c @@ -1197,6 +1197,7 @@ typedef struct resolv_cache_info { struct resolv_cache_info* next; char* nameservers[MAXNS +1]; struct addrinfo* nsaddrinfo[MAXNS + 1]; + char* domains; } CacheInfo; #define HTABLE_VALID(x) ((x) != NULL && (x) != HTABLE_DELETED) @@ -1989,7 +1990,8 @@ _resolv_set_default_iface(const char* ifname) } void -_resolv_set_nameservers_for_iface(const char* ifname, char** servers, int numservers) +_resolv_set_nameservers_for_iface(const char* ifname, char** servers, int numservers, + const char *domains) { int i, rt, index; struct addrinfo hints; @@ -2023,6 +2025,7 @@ _resolv_set_nameservers_for_iface(const char* ifname, char** servers, int numser cache_info->nsaddrinfo[index] = NULL; } } + cache_info->domains = strdup(domains); } pthread_mutex_unlock(&_res_cache_list_lock); } diff --git a/libc/private/resolv_iface.h b/libc/private/resolv_iface.h index f562687c6..3fe586ec0 100644 --- a/libc/private/resolv_iface.h +++ b/libc/private/resolv_iface.h @@ -48,7 +48,8 @@ __BEGIN_DECLS extern void _resolv_set_default_iface(const char* ifname); /* set name servers for an interface */ -extern void _resolv_set_nameservers_for_iface(const char* ifname, char** servers, int numservers); +extern void _resolv_set_nameservers_for_iface(const char* ifname, char** servers, int numservers, + const char *domains); /* tell resolver of the address of an interface */ extern void _resolv_set_addr_of_iface(const char* ifname, struct in_addr* addr);