On Sun, Oct 11, 2009 at 6:01 PM, Vitaliy Margolen <span dir="ltr">&lt;<a href="mailto:wine-devel@kievinfo.com">wine-devel@kievinfo.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Kai Blin wrote:<br>
&gt; On Saturday 10 October 2009 22:52:48 Vitaliy Margolen wrote:<br>
&gt;<br>
&gt;&gt;&gt; Changelog:<br>
&gt;&gt;&gt;     ws2_32: Use the routing table information for<br>
&gt;&gt;&gt; gethostbyname(&#39;self&#39;) if the magic IP would otherwise be returned.<br>
&gt;&gt; Thanks for the patch, however there are few issues with it.<br>
&gt;&gt;<br>
&gt;&gt; Why do you return a list of IP addresses from WS2_get_local_ips if you need<br>
&gt;&gt; only one? Just get the one with the lowest metric and return it.<br>
&gt;&gt;<br>
&gt;&gt; I think it would be better<br>
&gt;<br>
&gt; That&#39;s not what Windows does, though. Windows returns the full list.<br>
&gt;<br>
</div>Got you, then what the patch does is still can be improved.<br>
<br>
Since patch using WS2_get_local_ips() in one place only return something you<br>
can just pass directly to the app, not something that needs duplicating and<br>
then freeing.<font color="#888888"><br>
</font></blockquote></div><br>When I was first testing that&#39;s actually what I coded this routine to do, but the documentation indicates that the hostent returned by gethostbyname is not supposed to be freed by the application.  I assumed that part of the purpose of the WS_dup_he was to unify returning hostents so that (at some point down the line) the old memory allocated for them could be freed when there&#39;s a new call.<br>
<br>Erich Hoover<br><a href="mailto:ehoover@mines.edu">ehoover@mines.edu</a><br>