April 5, 2011

Turn off promiscuous mode console messages

I created a thread to continually sniff certain network packets at the datalink layer every few seconds using libpcap. eth0 is being opened in promiscuous mode. I do not want to leave the pcap object open, so I am calling pcap_open_live() and pcap_close() each time in the loop. This results in

entered promiscuous mode

and

left promiscuous mode

messages continually printed to the console.
How do I turn off or delete these messages? I looked in the libpcap source code, but could not find these messages.