[Live-devel] Problem with ourSourceAddressForMulticast()

xcsmith at rockwellcollins.com xcsmith at rockwellcollins.com
Thu Feb 1 14:07:35 PST 2007


Do you know of any way to work around this, or else know of some
alternative way to look up a valid IP address (rather than by
explicitly parsing the /etc/hosts file, which would be gross) that
will work on Linux systems (and not break on other systems)?  If so,
I could add it - as a third mechanism to try - to the
"ourSourceAddressForMulticast()" code.

Re:  I don't know if this will work, but I have computers which I want to
use eth1 instead of eth0 and I don't want to put a hardcoded IP for every
machine I run on.
I hacked up a small routine based on "ourSourceAddressForMulticast" to run
at the start of my application which uses ifaddrs.h "getifaddrs()" to get
the interfaces, which I think might use kernell calls to get the list of
interfaces, and not the /etc/hosts file.  I am using Linux, and a very
brief google search tells me that ifaddrs.h is not part of glibc and is
required for libpcap, so maybe it is on windows too?  When my network drive
is back online I can post the function for your evaluation if you think the
idea has potential.

Xochitl



More information about the live-devel mailing list