=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tftp/tftp.c,v retrieving revision 1.19 retrieving revision 1.20 diff -c -r1.19 -r1.20 *** src/usr.bin/tftp/tftp.c 2006/07/24 17:29:58 1.19 --- src/usr.bin/tftp/tftp.c 2006/07/26 09:10:03 1.20 *************** *** 1,4 **** ! /* $OpenBSD: tftp.c,v 1.19 2006/07/24 17:29:58 mglocker Exp $ */ /* $NetBSD: tftp.c,v 1.5 1995/04/29 05:55:25 cgd Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: tftp.c,v 1.20 2006/07/26 09:10:03 mglocker Exp $ */ /* $NetBSD: tftp.c,v 1.5 1995/04/29 05:55:25 cgd Exp $ */ /* *************** *** 35,41 **** static char sccsid[] = "@(#)tftp.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = ! "$OpenBSD: tftp.c,v 1.19 2006/07/24 17:29:58 mglocker Exp $"; #endif /* not lint */ /* --- 35,41 ---- static char sccsid[] = "@(#)tftp.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = ! "$OpenBSD: tftp.c,v 1.20 2006/07/26 09:10:03 mglocker Exp $"; #endif /* not lint */ /* *************** *** 162,168 **** /* send data to server and wait for server ACK */ for (timeouts = 0, error = 0; !intrflag;) { ! if (timeouts == maxtimeout) { printtimeout(); goto abort; } --- 162,168 ---- /* send data to server and wait for server ACK */ for (timeouts = 0, error = 0; !intrflag;) { ! if (timeouts >= maxtimeout) { printtimeout(); goto abort; } *************** *** 185,191 **** pfd[0].events = POLLIN; nfds = poll(pfd, 1, rexmtval * 1000); if (nfds == 0) { ! timeouts++; continue; } if (nfds == -1) { --- 185,191 ---- pfd[0].events = POLLIN; nfds = poll(pfd, 1, rexmtval * 1000); if (nfds == 0) { ! timeouts += rexmtval; continue; } if (nfds == -1) { *************** *** 295,301 **** /* send ACK to server and wait for server data */ for (timeouts = 0, error = 0; !intrflag;) { ! if (timeouts == maxtimeout) { printtimeout(); goto abort; } --- 295,301 ---- /* send ACK to server and wait for server data */ for (timeouts = 0, error = 0; !intrflag;) { ! if (timeouts >= maxtimeout) { printtimeout(); goto abort; } *************** *** 317,323 **** pfd[0].events = POLLIN; nfds = poll(pfd, 1, rexmtval * 1000); if (nfds == 0) { ! timeouts++; continue; } if (nfds == -1) { --- 317,323 ---- pfd[0].events = POLLIN; nfds = poll(pfd, 1, rexmtval * 1000); if (nfds == 0) { ! timeouts += rexmtval; continue; } if (nfds == -1) { *************** *** 602,608 **** } if (i == OPT_TIMEOUT) { /* verify OACK response */ ! n = strtonum(value, 1, 255, &errstr); if (errstr || rexmtval != n || opt_tout == 0) { nak(EOPTNEG); --- 602,609 ---- } if (i == OPT_TIMEOUT) { /* verify OACK response */ ! n = strtonum(value, TIMEOUT_MIN, TIMEOUT_MAX, ! &errstr); if (errstr || rexmtval != n || opt_tout == 0) { nak(EOPTNEG);