]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/cmd/ip/tftpd.c
tftpd: count only options we understand so we wont send empty oack message
[plan9front.git] / sys / src / cmd / ip / tftpd.c
index 7a6ec6f770d81cbe93689f02f7c414767359fde5..e0569b9599ba0f3bc2aa6d5385a5d9f6007361bd 100644 (file)
@@ -301,12 +301,13 @@ options(int fd, char *buf, int bufsz, char *file, ushort oper, char *p, int dlen
                        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 */
                if (nmlen < 0)