[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(usagi-users 02873) Re: IPv6 multicast in 2.4.25 broken?

Takashi Hibi <hibi665@xxxxxxx> wrote on 03/31/2004 05:01:29 AM:

> Isn't it related to the patch (usagi-users 02627)?
> http://www2.linux-ipv6.org/ml/usagi-users/msg02626.html

> If the socket is bound to non-multicast address, it can't receive multicast packets.

Oh, duh! I missed in the mail where it says it's bound to the
interface address.

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.
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).
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).


* an exception is multicast source filters, which can prevent a
 packet from being delivered that otherwise passes these tests.