aboutsummaryrefslogtreecommitdiff
path: root/etherent.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2023-05-05 04:32:51 -0700
committerGuy Harris <gharris@sonic.net>2023-05-05 15:07:11 -0700
commitb10eefd47f979a339aaeb247bf47cc333aa7ba91 (patch)
treec32b76c498a7bd4f8a7c2385e36161f229ecd475 /etherent.c
parent3d9930b78ff77629d52129bedeceba12a2fe2088 (diff)
Make some static variables thread-local.
This should make some functions thread-safe, even if it doesn't make them fully-reentrant; at least some of them would requiree API changes to full reentrancy. This should fix #1174.
Diffstat (limited to 'etherent.c')
-rw-r--r--etherent.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/etherent.c b/etherent.c
index 69da9a54..e0e5023c 100644
--- a/etherent.c
+++ b/etherent.c
@@ -33,6 +33,8 @@
#include <pcap/namedb.h>
+#include "thread-local.h"
+
#ifdef HAVE_OS_PROTO_H
#include "os-proto.h"
#endif
@@ -87,7 +89,7 @@ pcap_next_etherent(FILE *fp)
u_char d;
char *bp;
size_t namesize;
- static struct pcap_etherent e;
+ static thread_local struct pcap_etherent e;
memset((char *)&e, 0, sizeof(e));
for (;;) {