aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ypserv/yp_server.c
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2005-05-02 09:34:07 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2005-05-02 09:34:07 +0000
commit4e5a7758f63e00f98b845990662681189fab049b (patch)
treeef6b41df762c09c900d402c86a08b493f3f1ebc0 /usr.sbin/ypserv/yp_server.c
parent7c6523affc0efb6589ba11ccfec6dda9c681cafa (diff)
downloadsrc-4e5a7758f63e00f98b845990662681189fab049b.tar.gz
src-4e5a7758f63e00f98b845990662681189fab049b.zip
teach IPv6 to async DNS resolver in ypserv:
- query AAAA RR on ipnodes.byname query. - query .ip6.arpa. on ipnodes.byaddr query.
Notes
Notes: svn path=/head/; revision=145792
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 e6d82d62d715..8bd658be39ef 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);