net/pcap: fix timestamps in output pcap file
authorPiotr Bartosiewicz <piotr.bartosiewicz@atendesoftware.pl>
Tue, 13 Dec 2016 01:08:17 +0000 (02:08 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 17 Jan 2017 18:40:51 +0000 (19:40 +0100)
Fixes: 4c173302c307 ("pcap: add new driver")

Signed-off-by: Michał Mirosław <michal.miroslaw@atendesoftware.pl>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/pcap/rte_eth_pcap.c

index 0912245..7f0b650 100644 (file)
@@ -246,7 +246,7 @@ calculate_timestamp(struct timeval *ts) {
 
        cycles = rte_get_timer_cycles() - start_cycles;
        cur_time.tv_sec = cycles / hz;
-       cur_time.tv_usec = (cycles % hz) * 10e6 / hz;
+       cur_time.tv_usec = (cycles % hz) * 1e6 / hz;
        timeradd(&start_time, &cur_time, ts);
 }