[Live-devel] Problem with ourSourceAddressForMulticast()

Ross Finlayson finlayson at live555.com
Thu Feb 1 11:13:14 PST 2007


>- Setting ReceivingInterfaceAddr and SendingInterfaceAddr to a value 
>different from INADDR_ANY makes the multicast loopback trick fail.

If that happens, then you have a more serious problem: you've stopped 
multicast from working!  For multicast to work, your 
"ReceivingInterfaceAddr" - if not INADDR_ANY - must be set to the 
interface on which you have a route for 224.*.

>  I guess this is normal on a regular Linux configuration, without 
>multicast environment.

A regular Linux configuration *does* have multicast - at least, a 
route for 224.*.

>- Getting a valid IP address from gethostname() followed by 
>gethostbyname() doesn't work on most unix and linux systems as it 
>only returns the first entry in /etc/hosts file : 127.0.0.1. And 
>this IP address is rejected by badAddress().

That's not supposed to happen.  The code is supposed to check through 
*all* of the addresses returned by "gethostbyname()", and use the 
first address that is not bad (and 127.0.0.1 is considered 'bad').

>So, is it reasonnable to set a global static variable for the source address.

No.  If the code cannot find the machine's source address - using 
either of the two methods (multicast loopback or 
gethostname()/gethostbyname()) - then you probably have more serious 
problems that would prevent other parts of the code from working 
properly.  Allowing the programmer to 'paper over the problem' by 
specifying an address 'by hand' would likely cause more harm than 
good.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list