Simplified local IP reordering patch for default routes

Jamie Taylor Jamie.Taylor at
Thu Nov 26 22:00:01 CST 2015

On Thu, Nov 26, 2015 at 08:11:20PM +0800, Bruno Jesus wrote:
> Hi, Jamie and Joachim and list. This is a short version of a long
> patch I'm working on, it orders the IP list with the default routes on
> top and it supports more than one default route. It fixes the problem
> on Linux and FreeBSD, could anyone also test it on OSX, please?

I am away from my test setup until next week due to the Thanksgiving 
holiday in the USA, but I will do a test on OSX when I get back to it,
unless someone else has already reported results.  Based on my reading
of the patch, I expect it will work to solve the problem of the magic
loopback address being returned as the first entry.

Based on the results of the tests that Joachim shared with us,
I suspect a more correct approach (i.e., one that more closely matches
the results from Windows) may involve using GetIpAddrTable rather
than iterating over the IP forwarding table (except to figure out which
are the default routes) or using GetAdaptersInfo.  Of course, the wine
implementation of GetIpAddrTable may also not match the behavior of 
Windows when there are no adapters configured, but that may be a
problem whether or not WS_get_local_ips works correctly.
(I recognize that you are working on a larger patch which may address
this concern.)

Oh, and as for the reason the magic loopback address exists in the first
place, the best information that I could find was this thread on the list
from 2008, regarding the patch where it was introduced:
and specifically this post:

Hope this helps,

More information about the wine-devel mailing list