From: Mike Lovell <mike@dev-zero.net>
To: Samuel Thibault <samuel.thibault@labri.fr>,
Stefan Hajnoczi <stefanha@gmail.com>,
ped@listes.subiron.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PER] Re: socket, mcast looping back frames -> IPv6 broken
Date: Mon, 01 Apr 2013 00:35:03 -0600 [thread overview]
Message-ID: <51592A97.1050305@dev-zero.net> (raw)
In-Reply-To: <20130308124737.GS5863@type.youpi.perso.aquilenet.fr>
On 03/08/2013 05:47 AM, Samuel Thibault wrote:
> Samuel Thibault, le Fri 08 Mar 2013 10:08:55 +0100, a écrit :
>> There does exist some unique address, which is returned by recvfrom,
>> I'll have a look at how to get access to it.
> Ah, no, it's not unique... It's just the host IP address and the same
> port as the multicast address, so it'll be the same for all qemus on the
> same host. I've checked how Linux bounces the datagram, it's through
> the loopback interface, and thus dispatched over all listeners without
> distinction. I don't see any way to get the information that the packet
> comes from us, except using the ethernet content.
this is actually a problem that i dealt with when i was building the
switched multicast backend i did last year. (
http://lists.nongnu.org/archive/html/qemu-devel/2012-06/msg04082.html )
one solution is to actually use two sockets. one that is bound to the
multicast address, which receives the multicast packets, and another
that is just bound to any ephemeral udp port, which is used for sending
packets. when a packet is to be sent out to the multicast address, call
sendto on the ephemeral socket with a destination of the multicast
address. then, using recv_from on the multicast socket, packets being
received can be compared to the local ephemeral address. if the address
on the recv_from matches the address for the local ephemeral socket, the
packet can just be dropped. no inspection of the packet being passed
around is needed in this case.
if the group is interested is a solution like this, i can probably make
some time over the next couple days to cook up a patch. thoughts?
mike
next prev parent reply other threads:[~2013-04-01 6:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-05 16:35 [Qemu-devel] socket,mcast looping back frames -> IPv6 broken Samuel Thibault
2013-03-06 12:29 ` Stefan Hajnoczi
2013-03-06 13:15 ` [Qemu-devel] [PER] Re: socket, mcast " Samuel Thibault
2013-03-07 9:38 ` Stefan Hajnoczi
2013-03-07 17:14 ` Samuel Thibault
2013-03-08 8:43 ` Stefan Hajnoczi
2013-03-08 9:08 ` Samuel Thibault
2013-03-08 12:47 ` Samuel Thibault
2013-04-01 6:35 ` Mike Lovell [this message]
2013-04-01 9:32 ` Samuel Thibault
2013-04-08 11:12 ` Stefan Hajnoczi
2013-03-10 20:01 ` Samuel Thibault
2013-03-11 8:36 ` Stefan Hajnoczi
2013-04-01 0:12 ` [Qemu-devel] [PATCH] Document mcast+ipv6 (Was: Re: socket, mcast looping back frames -> IPv6 broken) Samuel Thibault
2013-04-08 11:13 ` Stefan Hajnoczi
2013-04-08 12:11 ` Samuel Thibault
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=51592A97.1050305@dev-zero.net \
--to=mike@dev-zero.net \
--cc=ped@listes.subiron.org \
--cc=qemu-devel@nongnu.org \
--cc=samuel.thibault@labri.fr \
--cc=stefanha@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.