On 04/23/2018 06:22 AM, Klebsch, Mario wrote: > Hi, > > I have a problem with multicast reception in the linux kernel and I hope, > this is the right place to ask for help or to report a bug. > > I need to receive multicasts on a single interface. I have written a small > program, which executes IP_ADD_MEMBERSHIP with imr.imr_ifindex set to the > interface index. The program works well, as long as only a single instance of > this program is running. If I start a second instance on a different network > interface, both programs receive multicast frames from both interfaces. > > When called without argument, the test program list the network interfaces. > When called with an interface name as argument, if starts receiving > multicasts on that interface. > > I am running vanilla Linux kernel 4.12.0. > > # uname -a > Linux c627 4.12.0 #1 SMP Mon Apr 23 14:08:24 CEST 2018 i686 Intel(R) Core(TM) > i5-7400 CPU @ 3.00GHz GenuineIntel GNU/Linux > # > > P.S. The program runs fine on MacOSX. >
It looks like your program needs to use SO_BINDTODEVICE if it really wants this device filtering ?