Simplified local IP reordering patch for default routes

Bruno Jesus 00cpxxx at
Thu Nov 26 22:57:26 CST 2015

On Friday, November 27, 2015, Jamie Taylor <Jamie.Taylor at> wrote:

> 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.

Thanks for the feedback. I'll wait your or someone else tests.

> 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.)

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.

> 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:
> <>
> 064850.html

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

Hope this helps,
> Jamie

Best wishes,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the wine-devel mailing list