From 3181f54059d8f111597b6e6ebec0e24f7939ada7 Mon Sep 17 00:00:00 2001 From: itojun <> Date: Mon, 11 Jun 2001 10:06:01 +0000 Subject: 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. --- src/lib/libc/net/getaddrinfo.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib/libc/net/getaddrinfo.c') 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 @@ -/* $OpenBSD: getaddrinfo.c,v 1.27 2000/08/31 17:41:51 itojun Exp $ */ +/* $OpenBSD: getaddrinfo.c,v 1.28 2001/06/11 10:05:58 itojun Exp $ */ /* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */ /* @@ -1511,6 +1511,7 @@ _yp_getaddrinfo(name, pai) extern const char *__hostalias __P((const char *)); extern int h_errno; +extern int res_opt __P((int, u_char *, int, int)); /* * Formulate a normal query, send, and await answer. @@ -1562,6 +1563,8 @@ res_queryN(name, target) n = res_mkquery(QUERY, name, class, type, NULL, 0, NULL, buf, sizeof(buf)); + if (n > 0 && (_res.options & RES_USE_EDNS0) != 0) + n = res_opt(n, buf, sizeof(buf), anslen); if (n <= 0) { #ifdef DEBUG if (_res.options & RES_DEBUG) -- cgit v1.2.3-55-g6feb