More verbose error message
This commit is contained in:
parent
917b2d9578
commit
7fb13a8e12
1 changed files with 3 additions and 2 deletions
5
nmrp.c
5
nmrp.c
|
@ -213,8 +213,9 @@ static int pkt_recv(struct ethsock *sock, struct nmrp_pkt *pkt)
|
||||||
msg_hdr_ntoh(&pkt->msg);
|
msg_hdr_ntoh(&pkt->msg);
|
||||||
len = pkt->msg.len + sizeof(pkt->eh);
|
len = pkt->msg.len + sizeof(pkt->eh);
|
||||||
|
|
||||||
if (bytes != len) {
|
if (bytes < len) {
|
||||||
fprintf(stderr, "Unexpected message length (%d bytes).\n", (int)len);
|
fprintf(stderr, "Short packet (expected %d, got %d).\n",
|
||||||
|
(int)len, (int)bytes);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue