Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a multithreading issue in writing pcap files (#204)
When there are separate threads that are sending and receiving packets, both threads may try to write the packet data to the pcap file. This causes the packet to get interleaved, thus basically making it corrupted and unable to be read by tcpdump, wireshark, etc. This is happening due to a missing lock on `self.cvar`. Fix it by wrapping the write call in the `send` method and the initial assignment in `start_pcap` method with a lock on `self.cvar`. Signed-off-by: Saikrishna Arcot <[email protected]>
- Loading branch information