Module: kamailio
Branch: master
Commit: 9132a4bbd39c0302204dd053bd1e563c02afed8e
URL:
https://github.com/kamailio/kamailio/commit/9132a4bbd39c0302204dd053bd1e563…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-09-08T12:52:53+02:00
sipdump: move use of spd fields after safety check
---
Modified: src/modules/sipdump/sipdump_pcap.c
---
Diff:
https://github.com/kamailio/kamailio/commit/9132a4bbd39c0302204dd053bd1e563…
Patch:
https://github.com/kamailio/kamailio/commit/9132a4bbd39c0302204dd053bd1e563…
---
diff --git a/src/modules/sipdump/sipdump_pcap.c b/src/modules/sipdump/sipdump_pcap.c
index 52ef7b3b92..e808ff23fe 100644
--- a/src/modules/sipdump/sipdump_pcap.c
+++ b/src/modules/sipdump/sipdump_pcap.c
@@ -125,8 +125,8 @@ void sipdump_write_pcap(FILE *fs, sipdump_data_t *spd)
char *p = NULL;
struct pcap_record_header v_pcap_record_header = {
- .ts_sec = spd->tv.tv_sec,
- .ts_usec = spd->tv.tv_usec,
+ .ts_sec = 0,
+ .ts_usec = 0,
};
struct pcap_ethernet_header v_pcap_ethernet_header = {
.type = 0,
@@ -148,6 +148,9 @@ void sipdump_write_pcap(FILE *fs, sipdump_data_t *spd)
return;
}
+ v_pcap_record_header.ts_sec = spd->tv.tv_sec;
+ v_pcap_record_header.ts_usec = spd->tv.tv_usec;
+
data = spd->data;
if((sipdump_mode & SIPDUMP_MODE_WPCAPEX) && (spd->data.len < BUF_SIZE
- 256)) {
if(_sipdump_pcap_data_buf == NULL) {