From f8d26986fd41b2caca88b4493c100e4b2585e78d Mon Sep 17 00:00:00 2001 From: mglocker <> Date: Wed, 26 Jul 2006 09:10:03 +0000 Subject: [PATCH] Fixing several timeout quirks at tftpd and tftp: - move TIMEOUT* defines to arpa/tftp.h, as they are used several times in tftpd and tftp, and the values are part of the RFC definition. - tftpd and tftp did count the total retransmission time in retries instead in seconds. fixed. - tftpd rexmt timeout was hardcoded by a define and therefore didn't changed when the timeout option was sent. fixed. - limit total retransmission timeout in tftp to also 255 seconds. - replace obvious atoi()'s by strtonum(). ok claudio@ --- src/include/arpa/tftp.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/include/arpa/tftp.h b/src/include/arpa/tftp.h index 0f6fe83a..8f9d4b89 100644 --- a/src/include/arpa/tftp.h +++ b/src/include/arpa/tftp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tftp.h,v 1.6 2006/07/20 09:42:44 mglocker Exp $ */ +/* $OpenBSD: tftp.h,v 1.7 2006/07/26 09:10:03 mglocker Exp $ */ /* $NetBSD: tftp.h,v 1.3 1994/10/26 00:56:48 cgd Exp $ */ /* @@ -41,6 +41,9 @@ #define SEGSIZE 512 /* data segment size */ #define SEGSIZE_MIN 8 /* minimal data segment size */ #define SEGSIZE_MAX 65464 /* maximal data segment size */ +#define TIMEOUT 5 /* packet rexmt timeout */ +#define TIMEOUT_MIN 1 /* minimal packet rexmt timeout */ +#define TIMEOUT_MAX 255 /* maximal packet rexmt timeout */ /* * Packet types.