On Thu, Nov 26, 2015 at 6:02 AM, Joachim Priesner joachim.priesner@web.de wrote:
Am Mittwoch, 25. November 2015 schrieb Jamie Taylor:
Interesting. Does GetAdaptersInfo return a non-null PIP_ADAPTER_INFO when there are no adapters on the (virtual) machine? How about GetIpAddrTable?
GetAdaptersInfo fails with ERROR_NO_DATA in this case. GetIpAddrTable returns the loopback IP address.
Does the list of addresses returned by gethostbyname(gethostname()) include the loopback address when there _are_ other adapters configured with IPv4 addresses?
No. (However, if there is a loopback adapter added manually, its address is returned, just like with all other adapters.)
(And if there are multiple loopback adapters installed/configured then are all of their addresses included?)
Yes.
Full test results in a Windows 8.1 VMware VM are here: http://pastebin.com/EjD5rec1
Thanks for the test, what is a manually added loopback adapter? Is there any use for it?
I'm working on a patch that seems to replicate all current known tests and probably will get rid of the magic loopback address (127.12.34.56) unless someone can really explain why it exists.