Skip to content

Commit

Permalink
Fix segfault on older libpcap
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Mar 16, 2024
1 parent 9851c3d commit 3ceb468
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rawsock-pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ int rawsock_loop(rawsock_callback func)
void rawsock_breakloop(void)
{
want_break = true;
pcap_breakloop(handle);
// calling pcap_breakloop on a dead handle should be a a no-op, but
// actually segfaults on libpcap 1.10.1 or older.
if(!dumper) {
pcap_breakloop(handle);
}
}

int rawsock_send(const uint8_t *pkt, int size)
Expand Down

0 comments on commit 3ceb468

Please sign in to comment.