From 6d38ac7cb9fc65ee94ebeb3e9cde11b27c2173bb Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 14 Mar 2011 09:46:19 -0700 Subject: [PATCH] ofp-print: Omit timestamp when printing packets in ofp_packet_to_string(). There's no value in the timestamp here, because it will always be the same. Printing it just makes results less reproducible because output then depends on the time zone. This fixes a test failure in California due to yesterday's DST change, and presumably a test failure almost everywhere else all the time. Reported-by: Andrew Evans --- lib/ofp-print.c | 2 +- tests/ofp-print.at | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ofp-print.c b/lib/ofp-print.c index d4f33daa..b4e69180 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -82,7 +82,7 @@ ofp_packet_to_string(const void *data, size_t len, size_t total_len OVS_UNUSED) } rewind(pcap); - snprintf(command, sizeof command, "/usr/sbin/tcpdump -e -n -r /dev/fd/%d 2>/dev/null", + snprintf(command, sizeof command, "/usr/sbin/tcpdump -t -e -n -r /dev/fd/%d 2>/dev/null", fileno(pcap)); tcpdump = popen(command, "r"); fclose(pcap); diff --git a/tests/ofp-print.at b/tests/ofp-print.at index af5249bc..d9ec6e88 100644 --- a/tests/ofp-print.at +++ b/tests/ofp-print.at @@ -230,7 +230,7 @@ dnl so trim off the end of the line where differences appear. AT_CHECK([sed 's/\(length 60:\).*/\1 .../' stdout], [0], [dnl OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=3 data_len=60 buffer=0x00000111 tunnel0:in_port0003:tci(0) mac50:54:00:00:00:05->50:54:00:00:00:06 type0800 proto6 tos0 ip192.168.0.1->192.168.0.2 port10031->0 --8:00:00.000000 50:54:00:00:00:05 > 50:54:00:00:00:06, ethertype IPv4 (0x0800), length 60: ... +50:54:00:00:00:05 > 50:54:00:00:00:06, ethertype IPv4 (0x0800), length 60: ... ]) AT_CLEANUP -- 2.30.2