Fix TFTP code

This commit is contained in:
Joseph C. Lehner 2016-02-07 21:21:43 +01:00
parent 8cab20c17e
commit 39b0033325

2
tftp.c
View file

@ -150,7 +150,7 @@ static ssize_t tftp_recvfrom(int sock, char *pkt, uint16_t* port,
*/
fprintf(stderr, "Error: %.32s\n", pkt);
return -3;
} else {
} else if (!opcode || opcode > ERR) {
fprintf(stderr, "Received invalid packet: ");
pkt_print(pkt, stderr);
fprintf(stderr, ".\n");