0

h_addr_list returns the list of IPv4 addresses on my system (both physical and virtual adapters). The order in which the list is populated co-incides with the order in which they are listed by ipconfig /all. If I change the order of adapters in control panel, I can see that the order followed in ipconfig /all output as well as in the h_addr_list also changes.

The problem I'm facing now is that on a couple of windows 8 physical machines on which VMware is installed, the order of addresses in h_addr_list isn't changing when I change the order in control panel. The change in order has an impact on the order of adapters in ipconfig /all output but not on the order of adresses in h_addr_list. Order is important to me because, my application returns the first IPV4 address found in the h_addr_list.

Please help.

  • So far as I can see, nothing in the [documentation](http://msdn.microsoft.com/en-us/library/windows/desktop/ms738552(v=vs.85).aspx) guarantees any particular order. So what you're seeing is just coincidence/luck, and probably shouldn't be relied upon. – Oliver Charlesworth Jul 19 '13 at 05:15
  • Is this what I'm looking for? A little confused :( http://support.microsoft.com/kb/171320 – user1441520 Jul 19 '13 at 05:28
  • update: When I ping my own hostname, what I see is - "reply from - link local IPv6 address - ..." of the virtual adapter whose IPv4 address is the first one in the h_addr_list. When I ping my own hostname, am I not supposed to get the IPv4 or IPv6 address of my physical adapter? – user1441520 Jul 20 '13 at 12:39

0 Answers0