Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/lib/libc/resolv Pull up following revision(s) (requested ...
details: https://anonhg.NetBSD.org/src/rev/c63a8c6eedf2
branches: netbsd-7
changeset: 798548:c63a8c6eedf2
user: martin <martin%NetBSD.org@localhost>
date: Wed Nov 12 13:54:13 2014 +0000
description:
Pull up following revision(s) (requested by christos in ticket #213):
lib/libc/resolv/res_mkquery.c: revision 1.14
PR/48475: YAMAGUCHI Takanori: EDNS option broken with unbound. struct
querybuf in net/gethnamaddr.c defines MAXPACKET to 64K. This in turn
gets passed down until it reached res_nopt(..., answer, anslen), where
the size of the buffer must fit in 16 bits. Unfortunately we end up
being one more than the max so we end up sending a 0 as the size and
unbound does not like that. Instead we clip now to 64K - 1, and everyone
is happy.
XXX: Pullup to 7.
diffstat:
lib/libc/resolv/res_mkquery.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (29 lines):
diff -r 6d4c4b376e19 -r c63a8c6eedf2 lib/libc/resolv/res_mkquery.c
--- a/lib/libc/resolv/res_mkquery.c Wed Nov 12 13:48:31 2014 +0000
+++ b/lib/libc/resolv/res_mkquery.c Wed Nov 12 13:54:13 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: res_mkquery.c,v 1.13 2012/03/13 21:13:43 christos Exp $ */
+/* $NetBSD: res_mkquery.c,v 1.13.10.1 2014/11/12 13:54:13 martin 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.13 2012/03/13 21:13:43 christos Exp $");
+__RCSID("$NetBSD: res_mkquery.c,v 1.13.10.1 2014/11/12 13:54:13 martin Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -251,7 +251,9 @@
*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 */
Home |
Main Index |
Thread Index |
Old Index