git: 9front

Download patch

ref: 3008798f1006b5457e87bf0597457c83cb3f5b1f
parent: 8bde6f3c0bd16f7d40c580cc8d568eabf0dc9340
author: cinap_lenrek <cinap_lenrek@felloff.net>
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 */
--