From 62c1fe7b450916acdaf4a3fe65a9b691d5d32f3f Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Tue, 6 Nov 2001 17:46:35 +0000 Subject: [PATCH] 1106. [bug] After seeing an out of range TTL, nsupdate would treat all TTLs as out of range. [RT #2001] --- CHANGES | 3 +++ bin/nsupdate/nsupdate.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 1f473e0397..de5fd2f056 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +1106. [bug] After seeing an out of range TTL, nsupdate would + treat all TTLs as out of range. [RT #2001] + 1105. [port] OpenUNIX 8 enable threads by default. [RT #1970] 1104. [bug] Invalid arguments to the transfer-format option diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c index b03cf34923..d77e344955 100644 --- a/bin/nsupdate/nsupdate.c +++ b/bin/nsupdate/nsupdate.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nsupdate.c,v 1.108 2001/10/15 20:23:47 bwelling Exp $ */ +/* $Id: nsupdate.c,v 1.109 2001/11/06 17:46:35 bwelling Exp $ */ #include @@ -1159,7 +1159,9 @@ update_addordelete(char *cmdline, isc_boolean_t isdelete) { if (isdelete) ttl = 0; - else if (ttl < 0 || ttl > TTL_MAX || errno == ERANGE) { + else if (ttl < 0 || ttl > TTL_MAX || + (ttl == LONG_MAX && errno == ERANGE)) + { /* * The errno test is needed to catch when strtol() * overflows on a platform where sizeof(int) ==