netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "Klebsch, Mario" <Mario.Klebsch@ime-actia.de>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: IP_ADD_MEMBERSHIP with imr_ifindex!=0 for multiple processes with different interfaces
Date: Mon, 23 Apr 2018 06:29:52 -0700	[thread overview]
Message-ID: <361cdca0-679a-cc16-6de1-b35479fbbb83@gmail.com> (raw)
In-Reply-To: <9208AF0D0E6F444F80E90796B4E51CA07C163C10@EXCHANGE01.muppets.local>



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 ?

      reply	other threads:[~2018-04-23 13:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23 13:22 IP_ADD_MEMBERSHIP with imr_ifindex!=0 for multiple processes with different interfaces Klebsch, Mario
2018-04-23 13:29 ` Eric Dumazet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=361cdca0-679a-cc16-6de1-b35479fbbb83@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=Mario.Klebsch@ime-actia.de \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).