Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Do you know what happens when Wireshark is activated

This is Linux, so:

It (or, rather, the libpcap library it uses) opens a PF_PACKET socket and binds it to the interface - or, if you're capturing on the "any" device, doesn't bind it - and starts getting packets from it.

If you're capturing in promiscuous mode, Wireshark (or, rather, the libpcap library) does a PACKET_ADD_MEMBERSHIP setsockopt() call, with a type of PACKET_MR_PROMISC, to put the interface into promiscuous mode.

and what kind of netlink messages does the kernel send to alert applications?

From a very quick look at the kernel code, it might only send a netlink message for the change to promiscuous mode (and the change from promiscuous mode from libpcap when Wireshark closes the device), so you may only see netlink messages if Wireshark puts the interface into promiscuous mode.