Figure out the local ip in a smarter way.

Instead of guessing based on the interface addresses and the target
address, use the local address of the socket used to pull down the
device description document.