projects
/
oweals
/
nmrpflash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
917b2d9
)
More verbose error message
author
Joseph C. Lehner
<joseph.c.lehner@gmail.com>
Mon, 8 Feb 2016 10:55:49 +0000
(11:55 +0100)
committer
Joseph C. Lehner
<joseph.c.lehner@gmail.com>
Mon, 8 Feb 2016 10:55:49 +0000
(11:55 +0100)
nmrp.c
patch
|
blob
|
history
diff --git
a/nmrp.c
b/nmrp.c
index 77ed6470ee14c6547295b2448ede5ba6b3af4ef9..4a7260c6170ad33fee9a466705a29d7d4fd155c1 100644
(file)
--- a/
nmrp.c
+++ b/
nmrp.c
@@
-213,8
+213,9
@@
static int pkt_recv(struct ethsock *sock, struct nmrp_pkt *pkt)
msg_hdr_ntoh(&pkt->msg);
len = pkt->msg.len + sizeof(pkt->eh);
- if (bytes != len) {
- fprintf(stderr, "Unexpected message length (%d bytes).\n", (int)len);
+ if (bytes < len) {
+ fprintf(stderr, "Short packet (expected %d, got %d).\n",
+ (int)len, (int)bytes);
return 1;
}