On Friday, November 27, 2015, Jamie Taylor <<a href="mailto:Jamie.Taylor@pobox.com">Jamie.Taylor@pobox.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Nov 26, 2015 at 08:11:20PM +0800, Bruno Jesus wrote:<br>
> Hi, Jamie and Joachim and list. This is a short version of a long<br>
> patch I'm working on, it orders the IP list with the default routes on<br>
> top and it supports more than one default route. It fixes the problem<br>
> on Linux and FreeBSD, could anyone also test it on OSX, please?<br>
<br>
I am away from my test setup until next week due to the Thanksgiving<br>
holiday in the USA, but I will do a test on OSX when I get back to it,<br>
unless someone else has already reported results.  Based on my reading<br>
of the patch, I expect it will work to solve the problem of the magic<br>
loopback address being returned as the first entry.</blockquote><div><br></div><div>Thanks for the feedback. I'll wait your or someone else tests.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Based on the results of the tests that Joachim shared with us,<br>
I suspect a more correct approach (i.e., one that more closely matches<br>
the results from Windows) may involve using GetIpAddrTable rather<br>
than iterating over the IP forwarding table (except to figure out which<br>
are the default routes) or using GetAdaptersInfo.  Of course, the wine<br>
implementation of GetIpAddrTable may also not match the behavior of<br>
Windows when there are no adapters configured, but that may be a<br>
problem whether or not WS_get_local_ips works correctly.<br>
(I recognize that you are working on a larger patch which may address<br>
this concern.)<br></blockquote><div><br></div><div>The complete version of the patch solves the loopback issues by ignoring the loopback routes. The loopback is only added if it is the only IP found as in Windows.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Oh, and as for the reason the magic loopback address exists in the first<br>
place, the best information that I could find was this thread on the list<br>
from 2008, regarding the patch where it was introduced:<br>
<a href="https://www.winehq.org/pipermail/wine-devel/2008-April/064835.html" target="_blank">https://www.winehq.org/pipermail/wine-devel/2008-April/064835.html</a><br>
and specifically this post:<br>
<a href="https://www.winehq.org/pipermail/wine-devel/2008-April/064850.html" target="_blank">https://www.winehq.org/pipermail/wine-devel/2008-April/</a>064850.html</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote><div><br></div><div>But now we won't return the loopback anymore so the first IP returned will be a valid network IP so this will no longer be necessary as far as I can see.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hope this helps,<br>
Jamie<br>
</blockquote><div><br></div><div>Best wishes, </div><div>Bruno <br></div>