mz: Make access to pcap init functions thread safe
commitdd5d906c40db5264d8d33c37565b39540f0258c8
authorVadim Kochan <vadim4j@gmail.com>
Sun, 22 Mar 2015 11:48:50 +0000 (22 13:48 +0200)
committerTobias Klauser <tklauser@distanz.ch>
Mon, 30 Mar 2015 12:08:50 +0000 (30 14:08 +0200)
tree8f4205351a4f104c6ebf0e883f58546738fb9e6f
parent895fdbb7d6b01e207103c8924c1c853f0fafee15
mz: Make access to pcap init functions thread safe

mz fails to start in cli mode and prints each time different pcap errors:

$ mz -x -V
fatal flex scanner internal error--end of buffer missed
rx_arp: [ERROR] Error calling pcap_compile

or simply shuts down. Sometimes it successfully gets up.
Seems some initialization pcap functions are not thread safer.

Fixed by using mutex locking before entering pcap_loop()

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
locking.h
staging/mopsrx_arp.c