[Live-devel] Multicast Interface Addr

xcsmith at rockwellcollins.com xcsmith at rockwellcollins.com
Thu May 31 13:02:00 PDT 2007


We *do* allow "ReceivingInterfaceAddr" to be something besides INADDR_ANY. 
 That's the whole point of the existing code.

Re:  But my change does not disable the ability to change the interface 
from the default.  The address parameter on the "bind" call specifies what 
destination addresses the socket will accept in the arriving packets.  If 
you use INADDR_ANY, you can accept data which specifies any address as the 
destination address.  If you specifiy ReceivingInterfaceAddr as, for 
example, 192.168.38.24, then your socket can ONLY receive data which was 
sent with 192.168.38.24 as the destination.  Data sent to that socket with 
a multicast address won't be received.

To my understanding, the bind() call is not setting the local interface on 
which we receive data, but instead creates a "filter" on the incoming data 
that the socket will accept .  From the HP site 
http://docs.hp.com/en/B9106-90013/IP.7P.html:

"
The application must also bind to the destination port number in order to 
receive datagrams that are sent to that port number. If the application 
binds to the address INADDR_ANY, it may receive all datagrams that are 
sent to the port number. If the application binds to a multicast group 
address, it may receive only datagrams sent to that group and port number. 
It is not necessary to join a multicast group in order to send datagrams 
to it.
"

The only thing my change does is allow the socket to receive all data sent 
to it.  The socket uses the ReceivingInterfaceAddr correctly when it sets 
the socket option IP_ADD_MEMBERSHIP.  Try this change out, and you will 
see that you are able to receive both unicast and multicast on eth1 even 
when eth0 and eth1 have a multicast route.  The code works the same as 
before, except now you can receive multicast on any interface you select.

Xochitl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live555.com/pipermail/live-devel/attachments/20070531/5f711435/attachment.html 


More information about the live-devel mailing list