From d91fb4d8ac423f782ceb863b20e40095b891231b Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Fri, 30 Oct 2015 23:16:24 +0100 Subject: [PATCH] Log when dropping packets in the test program. --- test.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test.c b/test.c index d138fd6..15d5772 100644 --- a/test.c +++ b/test.c @@ -69,8 +69,10 @@ ssize_t do_send(struct utcp *utcp, const void *data, size_t len) { int s = *(int *)utcp->priv; outpktno++; if(outpktno >= dropfrom && outpktno < dropto) { - if(drand48() < dropout) + if(drand48() < dropout) { + debug("Dropped outgoing packet\n"); return len; + } if(!reorder_data && drand48() < reorder) { reorder_data = malloc(len); if(!reorder_data) { @@ -214,6 +216,8 @@ int main(int argc, char *argv[]) { if(inpktno >= dropto || inpktno < dropfrom || drand48() >= dropin) { total_in += len; utcp_recv(u, buf, len); + } else { + debug("Dropped incoming packet\n"); } } -- 2.39.5