Project

General

Profile

Task #1278

Updated by Junxiao Shi about 10 years ago

Optimize `EthernetFace` so that it does not put NIC into promiscuous mode when possible. 

 This can When NIC has IPv4, and multicast Ethernet address happens to be achieved by `PACKET_ADD_MEMBERSHIP` in the range for IPv4 multicast 

 1. create libpcap session without promisc 
 2. calculate an IPv4 multicast address whose mapped Ethernet address happens to be the multicast Ethernet address 
 3. create a UDP socket option on Linux and `ioctl(SIOCADDMULTI)` join IP multicast using the calculated IPv4 multicast address 
 4. process libpcap captured packets normally; there’s no need to process packets on OSX. the UDP socket 
 5. close the UDP socket when libpcap session is closing 

 If the conditions are not met, libpcap session should still use promiscuous mode.

Back