cablelabs/rygel — pull request #23 by brendanlong (2014-09-25 18:45:28+00:00)
Title: Make dtcp-host config optional

It's extremely difficult to figure out what interface Rygel actually used, and it's impossible to use the same interface in all situations, because Rygel can listen on all of them, and we use the same MediaEngine for all of them.

Instead, I decided to just try to find the "best" IP address to use by:

1. Using an IP address from the "interfaces" list.
2. Using an IP address for an interface in the "interfaces" list.
3. Using any IP address.

For each thing, we also prefer IPv4 over IPv6 and prefer non-loopback interfaces.

Some things I don't like about this patch:

* Requiring the Linux package is annoying, but I can't find a reasonable cross-platform way to do this.
* I'm not sure if get_ip_address() belongs here or somewhere else.
* The scoring system seems non-ideal, since it's apparently-arbitrary numbers, but the alternative is much more verbose.