summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/getaddrinfo.c
diff options
context:
space:
mode:
authoritojun <>2001-06-11 10:06:01 +0000
committeritojun <>2001-06-11 10:06:01 +0000
commit3181f54059d8f111597b6e6ebec0e24f7939ada7 (patch)
treebfe7ada7d6c92fea65c972ec4fb3bcfcdbfc2dc5 /src/lib/libc/net/getaddrinfo.c
parente48fbbe799cf5b7ff38a184af2aa7f3ce90f7f65 (diff)
downloadopenbsd-3181f54059d8f111597b6e6ebec0e24f7939ada7.tar.gz
openbsd-3181f54059d8f111597b6e6ebec0e24f7939ada7.tar.bz2
openbsd-3181f54059d8f111597b6e6ebec0e24f7939ada7.zip
support EDNS0 (RFC2671) buffer size notification on DNS queries.
"options edns0" in /etc/resolv.conf will enable the behavior. no behavior change if you don't have the line. see resolv.conf(5) for more details. EDNS0 is useful for avoiding TCP DNS queries/replies on larger DNS responses. also, draft-ietf-dnsext-message-size-* plans to mandate EDNS0 support for DNS clients that support IPv6 transport.
Diffstat (limited to 'src/lib/libc/net/getaddrinfo.c')
-rw-r--r--src/lib/libc/net/getaddrinfo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/libc/net/getaddrinfo.c b/src/lib/libc/net/getaddrinfo.c
index 1326473fb7..0a0b112589 100644
--- a/src/lib/libc/net/getaddrinfo.c
+++ b/src/lib/libc/net/getaddrinfo.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getaddrinfo.c,v 1.27 2000/08/31 17:41:51 itojun Exp $ */ 1/* $OpenBSD: getaddrinfo.c,v 1.28 2001/06/11 10:05:58 itojun Exp $ */
2/* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */ 2/* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */
3 3
4/* 4/*
@@ -1511,6 +1511,7 @@ _yp_getaddrinfo(name, pai)
1511 1511
1512extern const char *__hostalias __P((const char *)); 1512extern const char *__hostalias __P((const char *));
1513extern int h_errno; 1513extern int h_errno;
1514extern int res_opt __P((int, u_char *, int, int));
1514 1515
1515/* 1516/*
1516 * Formulate a normal query, send, and await answer. 1517 * Formulate a normal query, send, and await answer.
@@ -1562,6 +1563,8 @@ res_queryN(name, target)
1562 1563
1563 n = res_mkquery(QUERY, name, class, type, NULL, 0, NULL, 1564 n = res_mkquery(QUERY, name, class, type, NULL, 0, NULL,
1564 buf, sizeof(buf)); 1565 buf, sizeof(buf));
1566 if (n > 0 && (_res.options & RES_USE_EDNS0) != 0)
1567 n = res_opt(n, buf, sizeof(buf), anslen);
1565 if (n <= 0) { 1568 if (n <= 0) {
1566#ifdef DEBUG 1569#ifdef DEBUG
1567 if (_res.options & RES_DEBUG) 1570 if (_res.options & RES_DEBUG)