Skip to content

Commit

Permalink
Merge pull request #25 from ng-labo/TSfromPcap
Browse files Browse the repository at this point in the history
Use pcapTimestamp if set, or readTimestamp when output is in tcpdump format.
  • Loading branch information
sflow committed Mar 5, 2019
2 parents a8bd313 + ae764d9 commit dac67e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sflowtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,7 @@ static void writePcapPacket(SFSample *sample) {
char buf[SA_MAX_PCAP_PKT];
int bytes = 0;
struct pcap_pkthdr hdr;
hdr.ts_sec = (uint32_t)time(NULL);
hdr.ts_sec = sample->pcapTimestamp ?: sample->readTimestamp;
hdr.ts_usec = 0;
hdr.len = sample->s.sampledPacketSize;
hdr.caplen = sample->s.headerLen;
Expand Down

0 comments on commit dac67e6

Please sign in to comment.