inpktno++;
if(inpktno >= dropto || inpktno < dropfrom || drand48() >= dropin) {
total_in += len;
- utcp_recv(u, buf, len);
+ if(utcp_recv(u, buf, len) == -1)
+ debug("Error receiving UTCP packet: %s\n", strerror(errno));
} else {
debug("Dropped incoming packet\n");
}
// In case this is for a CLOSED connection, ignore the packet.
// TODO: make it so incoming packets can never match a CLOSED connection.
- if(c->state == CLOSED)
+ if(c->state == CLOSED) {
+ debug("Got packet for closed connection\n");
return 0;
+ }
// It is for an existing connection.