diff options
author | itojun <> | 2001-06-11 10:06:01 +0000 |
---|---|---|
committer | itojun <> | 2001-06-11 10:06:01 +0000 |
commit | 3181f54059d8f111597b6e6ebec0e24f7939ada7 (patch) | |
tree | bfe7ada7d6c92fea65c972ec4fb3bcfcdbfc2dc5 /src/lib/libc/net/res_query.c | |
parent | e48fbbe799cf5b7ff38a184af2aa7f3ce90f7f65 (diff) | |
download | openbsd-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/res_query.c')
-rw-r--r-- | src/lib/libc/net/res_query.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/libc/net/res_query.c b/src/lib/libc/net/res_query.c index 01d1f691cb..433e80f648 100644 --- a/src/lib/libc/net/res_query.c +++ b/src/lib/libc/net/res_query.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: res_query.c,v 1.13 1999/09/27 23:58:26 alex Exp $ */ | 1 | /* $OpenBSD: res_query.c,v 1.14 2001/06/11 10:06:01 itojun Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * ++Copyright++ 1988, 1993 | 4 | * ++Copyright++ 1988, 1993 |
@@ -60,7 +60,7 @@ | |||
60 | static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; | 60 | static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; |
61 | static char rcsid[] = "$From: res_query.c,v 8.9 1996/09/22 00:13:28 vixie Exp $"; | 61 | static char rcsid[] = "$From: res_query.c,v 8.9 1996/09/22 00:13:28 vixie Exp $"; |
62 | #else | 62 | #else |
63 | static char rcsid[] = "$OpenBSD: res_query.c,v 1.13 1999/09/27 23:58:26 alex Exp $"; | 63 | static char rcsid[] = "$OpenBSD: res_query.c,v 1.14 2001/06/11 10:06:01 itojun Exp $"; |
64 | #endif | 64 | #endif |
65 | #endif /* LIBC_SCCS and not lint */ | 65 | #endif /* LIBC_SCCS and not lint */ |
66 | 66 | ||
@@ -87,6 +87,7 @@ static char rcsid[] = "$OpenBSD: res_query.c,v 1.13 1999/09/27 23:58:26 alex Exp | |||
87 | 87 | ||
88 | const char *hostalias __P((const char *)); | 88 | const char *hostalias __P((const char *)); |
89 | int h_errno; | 89 | int h_errno; |
90 | extern int res_opt __P((int, u_char *, int, int)); | ||
90 | 91 | ||
91 | /* | 92 | /* |
92 | * Formulate a normal query, send, and await answer. | 93 | * Formulate a normal query, send, and await answer. |
@@ -122,6 +123,8 @@ res_query(name, class, type, answer, anslen) | |||
122 | 123 | ||
123 | n = res_mkquery(QUERY, name, class, type, NULL, 0, NULL, | 124 | n = res_mkquery(QUERY, name, class, type, NULL, 0, NULL, |
124 | buf, sizeof(buf)); | 125 | buf, sizeof(buf)); |
126 | if (n > 0 && (_res.options & RES_USE_EDNS0) != 0) | ||
127 | n = res_opt(n, buf, sizeof(buf), anslen); | ||
125 | if (n <= 0) { | 128 | if (n <= 0) { |
126 | #ifdef DEBUG | 129 | #ifdef DEBUG |
127 | if (_res.options & RES_DEBUG) | 130 | if (_res.options & RES_DEBUG) |