Module Name:    src
Committed By:   sborrill
Date:           Thu Nov 20 08:41:31 UTC 2014

Modified Files:
        src/lib/libc/resolv [netbsd-5]: res_mkquery.c

Log Message:
Pull up the following revisions(s) (requested by christos in ticket #1932):
        lib/libc/resolv/res_mkquery.c:  revision 1.14

Fix EDNS option being broken with unbound by clipping MAXPACKET to
64K - 1. Addresses PR/48475


To generate a diff of this commit:
cvs rdiff -u -r1.10.4.1 -r1.10.4.2 src/lib/libc/resolv/res_mkquery.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/resolv/res_mkquery.c
diff -u src/lib/libc/resolv/res_mkquery.c:1.10.4.1 src/lib/libc/resolv/res_mkquery.c:1.10.4.2
--- src/lib/libc/resolv/res_mkquery.c:1.10.4.1	Thu Jan  6 21:42:48 2011
+++ src/lib/libc/resolv/res_mkquery.c	Thu Nov 20 08:41:31 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: res_mkquery.c,v 1.10.4.1 2011/01/06 21:42:48 riz Exp $	*/
+/*	$NetBSD: res_mkquery.c,v 1.10.4.2 2014/11/20 08:41:31 sborrill Exp $	*/
 
 /*
  * Portions Copyright (C) 2004, 2005, 2008  Internet Systems Consortium, Inc. ("ISC")
@@ -76,7 +76,7 @@
 static const char sccsid[] = "@(#)res_mkquery.c	8.1 (Berkeley) 6/4/93";
 static const char rcsid[] = "Id: res_mkquery.c,v 1.10 2008/12/11 09:59:00 marka Exp";
 #else
-__RCSID("$NetBSD: res_mkquery.c,v 1.10.4.1 2011/01/06 21:42:48 riz Exp $");
+__RCSID("$NetBSD: res_mkquery.c,v 1.10.4.2 2014/11/20 08:41:31 sborrill Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -249,7 +249,9 @@ res_nopt(res_state statp,
 	*cp++ = 0;				/*%< "." */
 	ns_put16(ns_t_opt, cp);			/*%< TYPE */
 	cp += INT16SZ;
-	ns_put16(anslen & 0xffff, cp);		/*%< CLASS = UDP payload size */
+	if (anslen > 0xffff)
+		anslen = 0xffff;
+	ns_put16(anslen, cp);			/*%< CLASS = UDP payload size */
 	cp += INT16SZ;
 	*cp++ = NOERROR;			/*%< extended RCODE */
 	*cp++ = 0;				/*%< EDNS version */

Reply via email to