SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,31 @@
cope with openbsd nonstandard bpf_timeval
Index: src/PcapInterface.cpp
--- src/PcapInterface.cpp.orig
+++ src/PcapInterface.cpp
@@ -289,9 +289,13 @@ static void* packetPollLoop(void* ptr) {
if(firstPktTS.tv_sec == 0) {
startTS = now;
- firstPktTS = hdr->ts;
+ firstPktTS.tv_sec = hdr->ts.tv_sec;
+ firstPktTS.tv_usec = hdr->ts.tv_usec;
} else {
- u_int32_t packetTimeDelta = Utils::msTimevalDiff(&hdr->ts, &firstPktTS);
+ timeval tmpt;
+ tmpt.tv_sec = hdr->ts.tv_sec;
+ tmpt.tv_usec = hdr->ts.tv_usec;
+ u_int32_t packetTimeDelta = Utils::msTimevalDiff(&tmpt, &firstPktTS);
u_int32_t fromStartTimeDelta = Utils::msTimevalDiff(&now, &startTS);
if (packetTimeDelta > fromStartTimeDelta) {
@@ -306,7 +310,8 @@ static void* packetPollLoop(void* ptr) {
}
}
- hdr->ts = now;
+ hdr->ts.tv_sec = now.tv_sec;
+ hdr->ts.tv_usec = now.tv_usec;
}
if((pkt != NULL) && (hdr->caplen > 0)) {