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

This commit is contained in:
cinap_lenrek 2015-07-11 02:35:49 +02:00
parent 0f5f226ba1
commit 1d5a2aa487

View file

@ -301,12 +301,13 @@ options(int fd, char *buf, int bufsz, char *file, ushort oper, char *p, int dlen
break; break;
dlen -= vallen; dlen -= vallen;
nopts++;
olen = 0; olen = 0;
op = handleopt(fd, p, val); op = handleopt(fd, p, val);
if (op == nil) if (op == nil)
continue; continue;
nopts++;
/* append OACK response to buf */ /* append OACK response to buf */
nmlen = emits(p, bp, ep); /* option name */ nmlen = emits(p, bp, ep); /* option name */
if (nmlen < 0) if (nmlen < 0)