diff options
Diffstat (limited to 'src/tools/ocbr')
| -rw-r--r-- | src/tools/ocbr/ocbr_client.c | 6 | ||||
| -rw-r--r-- | src/tools/ocbr/ocbr_server.c | 6 | 
2 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/ocbr/ocbr_client.c b/src/tools/ocbr/ocbr_client.c index ba7b41f4..eada6e60 100644 --- a/src/tools/ocbr/ocbr_client.c +++ b/src/tools/ocbr/ocbr_client.c @@ -129,7 +129,7 @@ int client_main(char * server,                          ++seqnr; -                        if (ts_diff_us(&start, &end) / MILLION >= duration) +                        if (ts_diff_us(&end, &start) / MILLION >= duration)                                  stop = true;                  }          } else { /* flood */ @@ -142,7 +142,7 @@ int client_main(char * server,                          ++seqnr; -                        if (ts_diff_us(&start, &end) / MILLION +                        if (ts_diff_us(&end, &start) / MILLION                              >= (long) duration)                                  stop = true;                  } @@ -151,7 +151,7 @@ int client_main(char * server,          clock_gettime(CLOCK_REALTIME, &end); -        ms = ts_diff_ms(&start, &end); +        ms = ts_diff_ms(&end, &start);          printf("sent statistics: "                 "%9ld packets, %12ld bytes in %9d ms, %4.4f Mb/s\n", diff --git a/src/tools/ocbr/ocbr_server.c b/src/tools/ocbr/ocbr_server.c index a4bbadd4..34c4fa94 100644 --- a/src/tools/ocbr/ocbr_server.c +++ b/src/tools/ocbr/ocbr_server.c @@ -114,14 +114,14 @@ static void handle_flow(int fd)                          bytes_read += count;                  } -                if (ts_diff_us(&alive, &now) +                if (ts_diff_us(&now, &alive)                      > server_settings.timeout * MILLION) {                          printf("Test on flow %d timed out\n", fd);                          stop = true;                  } -                if (stop || ts_diff_ms(&now, &iv_end) < 0) { -                        long us = ts_diff_us(&iv_start, &now); +                if (stop || ts_diff_ms(&now, &iv_end) > 0) { +                        long us = ts_diff_us(&now, &iv_start);                          printf("Flow %4d: %9ld packets (%12ld bytes) in %9ld ms"                                 " => %9.4f pps, %9.4f Mbps\n",                                 fd,  | 
