shithub: riscv

Download patch

ref: 1d5a2aa48778960fc9b5ab0b39f83a5322c3f754
parent: 0f5f226ba1ccbc3b134c77a33503ad2182c05e5a
author: cinap_lenrek <[email protected]>
date: Fri Jul 10 22:35:49 EDT 2015

tftpd: count only options we understand so we wont send empty oack message

--- a/sys/src/cmd/ip/tftpd.c
+++ b/sys/src/cmd/ip/tftpd.c
@@ -301,11 +301,12 @@
 			break;
 		dlen -= vallen;
 
-		nopts++;
 		olen = 0;
 		op = handleopt(fd, p, val);
 		if (op == nil)
 			continue;
+
+		nopts++;
 
 		/* append OACK response to buf */
 		nmlen = emits(p, bp, ep);	/* option name */