From 6f3222ea42f4d2335b089b3d2e5834a5c8c22eca Mon Sep 17 00:00:00 2001 From: Robert Greenwalt Date: Tue, 13 Nov 2012 11:50:57 -0800 Subject: [PATCH] Add search domain to dns interface data. This doesn't currently use this info - it's still using the system property based data-passing. That change is comming. bug:6799630 Change-Id: I725463209855447cd04bf1457281f3084fffd692 --- libc/netbsd/resolv/res_cache.c | 5 ++++- libc/private/resolv_iface.h | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) 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);