@@ -50,7 +50,7 @@ static int cfg_rcv_timeout_ms;
static struct sockaddr_storage cfg_bind_addr;
static bool interrupted;
-static unsigned long packets, bytes;
+static unsigned long packets, total_packets, bytes;
static void sigint_handler(int signum)
{
@@ -405,6 +405,7 @@ static void do_recv(void)
"%s rx: %6lu MB/s %8lu calls/s\n",
cfg_tcp ? "tcp" : "udp",
bytes >> 20, packets);
+ total_packets += packets;
bytes = packets = 0;
treport = tnow + 1000;
}
@@ -415,7 +416,7 @@ static void do_recv(void)
if (cfg_expected_pkt_nr && (packets != cfg_expected_pkt_nr))
error(1, 0, "wrong packet number! got %ld, expected %d\n",
- packets, cfg_expected_pkt_nr);
+ total_packets + packets, cfg_expected_pkt_nr);
if (close(fd))
error(1, errno, "close");