NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/48475: "options edns0" in /etc/resolv.conf (or RES_OPTIONS=edns0) is broken



>Number:         48475
>Category:       lib
>Synopsis:       "options edns0" in /etc/resolv.conf (or RES_OPTIONS=edns0) is 
>broken
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 24 02:40:00 +0000 2013
>Originator:     YAMAGUCHI Takanori
>Release:        NetBSD 6.1.2
>Organization:
>Environment:
NetBSD 6.1.2 (GENERIC) i386
>Description:
When enables edns0 in resolv.conf, resolver sends a query that UDP payload size 
is always 0. It must be larger than 512.
Unbound caching dns server returns SERVFAIL response to that query.
>How-To-Repeat:
% cat /etc/resolv.conf
nameserver 127.0.0.1     # unbound
options edns0
% getent hosts www.netbsd.org

>Fix:
--- lib/libc/resolv/res_mkquery.c.orig  2012-03-14 13:31:08.000000000 +0900
+++ lib/libc/resolv/res_mkquery.c       2013-12-24 10:17:56.000000000 +0900
@@ -251,6 +251,8 @@
        *cp++ = 0;                              /*%< "." */
        ns_put16(ns_t_opt, cp);                 /*%< TYPE */
        cp += INT16SZ;
+       if (anslen > 0xffff)
+               anslen = 0xffff;
        ns_put16(anslen & 0xffff, cp);          /*%< CLASS = UDP payload size */
        cp += INT16SZ;
        *cp++ = NOERROR;                        /*%< extended RCODE */

same as:
http://svnweb.freebsd.org/base/head/lib/libc/resolv/res_mkquery.c?r1=156953&r2=156956
http://www.freshbsd.org/commit/openbsd/16a3d261bc0fcded7d8d515415436c5b5f2e291a



Home | Main Index | Thread Index | Old Index