diff mbox series

[ovs-dev,7/7] pcap-file: Use time macros.

Message ID 1510158959-16851-8-git-send-email-bhanuprakash.bodireddy@intel.com
State Changes Requested
Headers show
Series Introduce high resolution sleep support. | expand

Commit Message

Bodireddy, Bhanuprakash Nov. 8, 2017, 4:35 p.m. UTC
Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
---
 lib/pcap-file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/pcap-file.c b/lib/pcap-file.c
index 981d56d..60280fb 100644
--- a/lib/pcap-file.c
+++ b/lib/pcap-file.c
@@ -174,7 +174,7 @@  ovs_pcap_read(FILE *file, struct dp_packet **bufp, long long int *when)
     if (when) {
         uint32_t ts_sec = swap ? uint32_byteswap(prh.ts_sec) : prh.ts_sec;
         uint32_t ts_usec = swap ? uint32_byteswap(prh.ts_usec) : prh.ts_usec;
-        *when = ts_sec * 1000LL + ts_usec / 1000;
+        *when = ts_sec * MSEC_PER_SEC + ts_usec / USEC_PER_MSEC;
     }
 
     /* Read packet. Packet type is Ethernet */