shithub: riscv

Download patch

ref: d5c906f51587975420b94c5a21aead9152864f18
parent: 66eac7d687219c71a9e3482f80b62de8b3693423
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon May 21 21:53:15 EDT 2018

ip/tftpd: deal with block wrap arround

--- a/sys/src/cmd/ip/tftpd.c
+++ b/sys/src/cmd/ip/tftpd.c
@@ -542,9 +542,9 @@
 		if (Debug)
 			syslog(dbg, flog, "tftpd %d read ack of %d bytes "
 				"for block %d", pid, al, ackblock);
-		if(ackblock == block)
+		if(ackblock == (block & 0xffff))
 			return Ackok;		/* for block just sent */
-		else if(ackblock == block + 1)	/* intel pxe eof bug */
+		else if(ackblock == (block + 1 & 0xffff))	/* intel pxe eof bug */
 			return Ackok;
 		else if(ackblock == 0xffff)
 			return Ackrexmit;