From 5733d25b06b46067b3751d10436d82aef09cd705 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Mon, 2 Jul 2001 20:46:31 +0000 Subject: [PATCH] 921. [bug] lwres returned an incorrect error code if it received a truncated message. 920. [func] Increase the lwres receive buffer size to 16K. [RT #1451] --- CHANGES | 6 ++++++ lib/lwres/context.c | 5 ++++- lib/lwres/include/lwres/lwres.h | 6 +++--- lib/lwres/include/lwres/result.h | 3 ++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index e51a603d49..abbc6adc84 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,10 @@ + 921. [bug] lwres returned an incorrect error code if it received + a truncated message. + + 920. [func] Increase the lwres receive buffer size to 16K. + [RT #1451] + 919. [placeholder] 918. [func] In nsupdate, TSIG errors are no longer treated as diff --git a/lib/lwres/context.c b/lib/lwres/context.c index 530209db06..37cc57517c 100644 --- a/lib/lwres/context.c +++ b/lib/lwres/context.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: context.c,v 1.35 2001/06/07 00:45:35 bwelling Exp $ */ +/* $Id: context.c,v 1.36 2001/07/02 20:46:28 bwelling Exp $ */ #include @@ -301,6 +301,9 @@ lwres_context_recv(lwres_context_t *ctx, if (ret < 0) return (LWRES_R_IOERROR); + if (ret == recvlen) + return (LWRES_R_TOOLARGE); + /* * If we got something other than what we expect, have the caller * wait for another packet. This can happen if an old result diff --git a/lib/lwres/include/lwres/lwres.h b/lib/lwres/include/lwres/lwres.h index d953ce0d93..724406f33d 100644 --- a/lib/lwres/include/lwres/lwres.h +++ b/lib/lwres/include/lwres/lwres.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lwres.h,v 1.48 2001/03/08 16:09:40 tale Exp $ */ +/* $Id: lwres.h,v 1.49 2001/07/02 20:46:29 bwelling Exp $ */ #ifndef LWRES_LWRES_H #define LWRES_LWRES_H 1 @@ -77,8 +77,8 @@ * response_free(). */ -#define LWRES_UDP_PORT 921 /* XXXMLG */ -#define LWRES_RECVLENGTH 4096 /* XXXMLG */ +#define LWRES_UDP_PORT 921 +#define LWRES_RECVLENGTH 16384 #define LWRES_ADDR_MAXLEN 16 /* changing this breaks ABI */ #define LWRES_RESOLV_CONF "/etc/resolv.conf" diff --git a/lib/lwres/include/lwres/result.h b/lib/lwres/include/lwres/result.h index 14d12ec9f6..76e88ad231 100644 --- a/lib/lwres/include/lwres/result.h +++ b/lib/lwres/include/lwres/result.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.h,v 1.13 2001/01/09 21:59:51 bwelling Exp $ */ +/* $Id: result.h,v 1.14 2001/07/02 20:46:31 bwelling Exp $ */ #ifndef LWRES_RESULT_H #define LWRES_RESULT_H 1 @@ -35,5 +35,6 @@ typedef unsigned int lwres_result_t; #define LWRES_R_INCOMPLETE 10 #define LWRES_R_RETRY 11 #define LWRES_R_TYPENOTFOUND 12 +#define LWRES_R_TOOLARGE 13 #endif /* LWRES_RESULT_H */