How to bind multiple interface to a raw socket
Hi ,
I have opened a raw socket to get all the raw packets.
socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)
When a packet is received on an interface which is member of a LAG or bond , the kernel is sending the packets to the user application 2 times. One for the actual physical interface and another one for the bond interface. How to restrict the kernel to lift the packet only for the interface which i am interested.
We can achieve it by binding the application interested interface to the socket. But i don't want to create multiple sockets ( one for each interface) to avoid scalablity issue. Is it possible to bind multiple interface to the raw socket dynamically ?
Thanks in advance
|