Skip to content

Commit 7edef24

Browse files
committed
Fix missing pcap_fopen_offline_with_tstamp_precision. Fixes google#611
This happened due to merging tstamp + unix/windows split. Problem is that the #define used for checking if this is missing is defined by the check above...
1 parent 78d13ea commit 7edef24

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

pcap/pcap_unix.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ pcap_t *pcap_open_offline_with_tstamp_precision(const char *fname, u_int precisi
6969
return pcap_open_offline(fname, errbuf);
7070
}
7171
72+
pcap_t *pcap_fopen_offline_with_tstamp_precision(FILE *fp, u_int precision,
73+
char *errbuf) {
74+
return pcap_fopen_offline(fp, errbuf);
75+
}
76+
7277
int pcap_set_tstamp_precision(pcap_t *p, int tstamp_precision) {
7378
if (tstamp_precision == PCAP_TSTAMP_PRECISION_MICRO)
7479
return 0;
@@ -161,15 +166,6 @@ int pcap_wait(pcap_t *p, int usec) {
161166
return select(fd+1, &fds, NULL, NULL, NULL);
162167
}
163168
164-
// libpcap version < v1.5 doesn't have timestamp precision (everything is microsecond)
165-
// see pcap.go for an explanation of why precision is ignored
166-
#ifndef PCAP_ERROR_TSTAMP_PRECISION_NOTSUP // < v1.5
167-
pcap_t *pcap_fopen_offline_with_tstamp_precision(FILE *fp, u_int precision,
168-
char *errbuf) {
169-
return pcap_fopen_offline(fp, errbuf);
170-
}
171-
#endif // < v1.5
172-
173169
*/
174170
import "C"
175171

0 commit comments

Comments
 (0)