Re: Kernel Multicast

From: Jean Tourrilhes (jt@bougret.hpl.hp.com)
Date: Tue Aug 28 2001 - 13:34:18 EST


On Tue, Aug 28, 2001 at 02:30:56PM -0400, Ion Badulescu wrote:
> On Tue, 28 Aug 2001 11:13:21 -0700, Jean Tourrilhes <jt@bougret.hpl.hp.com> wrote:
>
> > And finally, I tried :
> > ------------------------------------------
> > bind(sock, ONE_INTERFACE, MY_PORT);
> > ------------------------------------------
> > First instance : Tx ok, doesn't Rx anything at all. I can
> > understand why, the Rx packet don't have a dest IP address matching
> > ONE_INTERFACE.
>
> This is the correct approach, I think. Have you tried adding the two
> setsockopt() calls after the bind, or at the very least the
> IP_ADD_MEMBERSHIP one, to see if you can Rx?

        Hum, I thought it was obvious. I did mention only this call
because that's the only difference, but what I did was :
------------------------------------------
socket(AF_INET, SOCK_DGRAM, 0);
bind(sock, ONE_INTERFACE, MY_PORT);
setsockopt(IP_ADD_MEMBERSHIP, INADDR_ALLHOSTS_GROUP, ONE_INTERFACE);
setsockopt(IP_MULTICAST_IF, ONE_INTERFACE);
------------------------------------------
        And in this case, no Rx at all !

> Otherwise quite obviously
> your physical interface will not have the multicast MAC address added to
> its filters and no packets will reach the IP stack.
>
> 'ip maddr ls' is a useful tool for inspecting what your NIC is letting
> through.

        I'll try that...

> Ion

        Jean
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Aug 31 2001 - 21:00:30 EST