[PATCH 2/2] ws2_32: Use the routing table information for gethostbyname('self') if the magic IP would otherwise be returned. [Try 2]

Erich Hoover ehoover at mines.edu
Mon Oct 12 22:09:05 CDT 2009


Real Name:
    Erich Hoover
Description:
    If an application calls gethostbyname on it's own hostname then it
expects an IP to be returned for each interface, in order of the
routing priority (see MS Knowledge Base article #160215).  The
attached patch first checks to see if the gethostbyname request
resolved to a loopback address (which currently gets replaced by the
magic IP).  If the magic IP would have been returned then it uses the
routing table to build the list of IP addresses and properly sorts
those addresses from highest routing priority to lowest routing
priority (lowest metric to highest metric).  This version of the patch
addresses several issues mentioned on wine-devel:
    1) A user-returnable hostent is allocated initially, rather than
allocating a temporary hostent, duplicating it, and then releasing it.
    2) Calls to "HeapAlloc" now have spaces after commas.
    3) No-longer checks for a NULL pointer before calling "HeapFree."
Changelog:
    ws2_32: Use the routing table information for
gethostbyname('self') if the magic IP would otherwise be returned.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ws2_32-Use-the-routing-table-information-for-gethos.patch
Type: text/x-patch
Size: 7081 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20091012/7fa47961/attachment.bin>


More information about the wine-patches mailing list