summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ypserv/yp_server.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2005-05-02 09:34:07 +0000
committerume <ume@FreeBSD.org>2005-05-02 09:34:07 +0000
commit359f287f5157e24e483c8fdd6b54a0ba7b4701dc (patch)
treeef6b41df762c09c900d402c86a08b493f3f1ebc0 /usr.sbin/ypserv/yp_server.c
parentd1bb5343c0ad00dbe06df9eba8310e5c10311aa4 (diff)
downloadFreeBSD-src-359f287f5157e24e483c8fdd6b54a0ba7b4701dc.zip
FreeBSD-src-359f287f5157e24e483c8fdd6b54a0ba7b4701dc.tar.gz
teach IPv6 to async DNS resolver in ypserv:
- query AAAA RR on ipnodes.byname query. - query .ip6.arpa. on ipnodes.byaddr query.
Diffstat (limited to 'usr.sbin/ypserv/yp_server.c')
-rw-r--r--usr.sbin/ypserv/yp_server.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/usr.sbin/ypserv/yp_server.c b/usr.sbin/ypserv/yp_server.c
index e6d82d6..8bd658b 100644
--- a/usr.sbin/ypserv/yp_server.c
+++ b/usr.sbin/ypserv/yp_server.c
@@ -166,9 +166,10 @@ ypproc_match_2_svc(ypreq_key *argp, struct svc_req *rqstp)
#ifdef DB_CACHE
if (result.stat != YP_TRUE &&
(yp_testflag(argp->map, argp->domain, YP_INTERDOMAIN) ||
- (strstr(argp->map, "hosts") && do_dns))) {
+ ((strstr(argp->map, "hosts") || strstr(argp->map, "ipnode")) && do_dns))) {
#else
- if (do_dns && result.stat != YP_TRUE && strstr(argp->map, "hosts")) {
+ if (do_dns && result.stat != YP_TRUE &&
+ (strstr(argp->map, "hosts") || strstr(argp->map, "ipnode"))) {
#endif
char nbuf[YPMAXRECORD];
@@ -180,9 +181,17 @@ ypproc_match_2_svc(ypreq_key *argp, struct svc_req *rqstp)
yp_error("doing DNS lookup of %s", nbuf);
if (!strcmp(argp->map, "hosts.byname"))
- result.stat = yp_async_lookup_name(rqstp, nbuf);
+ result.stat = yp_async_lookup_name(rqstp, nbuf,
+ AF_INET);
else if (!strcmp(argp->map, "hosts.byaddr"))
- result.stat = yp_async_lookup_addr(rqstp, nbuf);
+ result.stat = yp_async_lookup_addr(rqstp, nbuf,
+ AF_INET);
+ else if (!strcmp(argp->map, "ipnodes.byname"))
+ result.stat = yp_async_lookup_name(rqstp, nbuf,
+ AF_INET6);
+ else if (!strcmp(argp->map, "ipnodes.byaddr"))
+ result.stat = yp_async_lookup_addr(rqstp, nbuf,
+ AF_INET6);
if (result.stat == YP_TRUE)
return(NULL);
OpenPOWER on IntegriCloud