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?
This patch does not touch the magic IP so the loopback route will still return the IP 127.12.34.56 but at least it won't be the first one anymore.
Thanks in advance, Bruno
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: https://www.winehq.org/pipermail/wine-devel/2008-April/064835.html and specifically this post: https://www.winehq.org/pipermail/wine-devel/2008-April/064850.html
Hope this helps, Jamie
On Friday, November 27, 2015, Jamie Taylor Jamie.Taylor@pobox.com 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: https://www.winehq.org/pipermail/wine-devel/2008-April/064835.html and specifically this post: https://www.winehq.org/pipermail/wine-devel/2008-April/ https://www.winehq.org/pipermail/wine-devel/2008-April/064850.html 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 see.
Hope this helps,
Jamie
Best wishes, Bruno
On Thu, Nov 26, 2015 at 11:00:01PM -0500, Jamie Taylor 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,
Works for me on OSX.
Jamie
On Wed, Dec 2, 2015 at 5:56 AM, Jamie Taylor Jamie.Taylor@pobox.com wrote:
On Thu, Nov 26, 2015 at 11:00:01PM -0500, Jamie Taylor 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,
Works for me on OSX.
Thanks for the test, patch will be submitted after code freeze.
On Tue, Dec 1, 2015 at 8:24 PM, Bruno Jesus 00cpxxx@gmail.com wrote:
On Wed, Dec 2, 2015 at 5:56 AM, Jamie Taylor Jamie.Taylor@pobox.com wrote:
On Thu, Nov 26, 2015 at 11:00:01PM -0500, Jamie Taylor 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,
Works for me on OSX.
Thanks for the test, patch will be submitted after code freeze.
Hi Bruno,
Should this help with ws2_32/sock.c failing? On my Gentoo machine, this test fails: sock.c:4402: Test failed: address does not match: 0.0.0.0 != 127.12.34.56
It also fails with your patch. The patch does fix one todo test, however: sock.c:4549: Test succeeded inside todo block: failed to find the first IP from gethostbyname!
On Wednesday, December 2, 2015, Austin English austinenglish@gmail.com wrote:
Hi Bruno,
Hello, Austin.
Should this help with ws2_32/sock.c failing? On my Gentoo machine, this test fails: sock.c:4402: Test failed: address does not match: 0.0.0.0 != 127.12.34.56
It also fails with your patch. The patch does fix one todo test, however: sock.c:4549: Test succeeded inside todo block: failed to find the first IP from gethostbyname!
This is the first patch in a series, I believe that the final version will fix that problem.