From: Joseph C. Lehner Date: Sun, 7 Feb 2016 20:21:43 +0000 (+0100) Subject: Fix TFTP code X-Git-Tag: v0.9~28 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=39b00333253c80698843e81e3fe4a14ed21af709;p=oweals%2Fnmrpflash.git Fix TFTP code --- diff --git a/tftp.c b/tftp.c index 7c21304..9d6ae51 100644 --- a/tftp.c +++ b/tftp.c @@ -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");