[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
(usagi-users 02874) Re: IPv6 multicast in 2.4.25 broken?
On Wed, Mar 31, 2004 at 08:28:54AM -0800, thus spake David Stevens:
> It was a bug in earlier code to deliver multicast packets
> based on whether a join had been done on the socket and your
> application was apparently relying on that bug.
Absolutely right. =)
> Group membership is per-interface and joining a group
> on a socket only determines whether multicasts for that group
> will be delivered to the local machine on that interface.
> Whether a multicast packet for a (interface,group) pair
> that has been joined is delivered to a particular
> socket or not depends on how the socket is bound (only*-- just
> like unicasts). Sockets bound to the group address or the
> unspecified address (inaddr_any) will be delivered. All others
> don't pass UDP bind matching and won't be delivered (and that's
> correct behavior).
Is this done that way to allow the same socket to join more than one
group (hence binding to in6addr_any)?
> Your application should either bind to the (single)
> multicast address you're interested in or to the unspecified
> address if you want to receive from multiple groups. The latter
> will receive packets for ALL groups (even ones you didn't join,
> but another process did) and unicasts if those packets are sent
> with the same protocol (ie, UDP) and have matching port(s).
Yeah, this seems wrong at first glance. For a socket bound to
in6addr_any, is there no way to simply check if it has joined the group
to which the packet is destined? This is the most natural way one
could thinks of. Moreover, one wouldn't like to be "polluted" by
multicast packets, for the simple reason that someone is using the same
port, but for multicast communications. It seems to me that there
should be some scheme to protect against those cases.
Any thoughts?
--
Save the whales. Feed the hungry. Free the mallocs.