<div dir="ltr">Hi Sven,<div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jun 14, 2014 at 4:09 AM, Sven Van Caekenberghe <span dir="ltr"><<a href="mailto:sven@stfx.eu" target="_blank">sven@stfx.eu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5"><br>
On 14 Jun 2014, at 12:18, Ben Coman <btc@openInWorld.com> wrote:<br>
<br>
> Sven Van Caekenberghe wrote:<br>
>> In any case, the server socket used is normally listening on all interfaces [0.0.0.0]<br>
>><br>
>> Sven<br>
>><br>
>><br>
><br>
> Maybe it matters that [0.0.0.0] is the IPv4-Unspecified-Address<br>
> and it might make a difference to use IPv6-Unspecified-Address [0:0:0:0:0:0:0:0] or [::]<br>
><br>
> cheers -ben<br>
<br>
</div></div>I guess it all depends on the Socket plugin. ZnServer has #bindingAddress: which eventually calls Socket>>#listenOn:backlogSize:interface: but the question is, what is acceptable as last argument. And how is the difference between v4 and v6 handled. There is a 'primitives-ipv6' category, but no #listenOn with an interface there.<br>
</blockquote></div><div class="gmail_extra"><br></div>I wonder whether this commit is relevant:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">r2552 | eliot | 2012-05-02 16:13:02 -0700 (Wed, 02 May 2012) | 19 lines</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">CogVM source as per VMMakerr.oscog-eem.159</div><div class="gmail_extra">...</div><div class="gmail_extra"><br></div><div class="gmail_extra">Fix limitation in platforms/unix/plugins/SocketPlugin/sqUnixSocket.c which could</div>
<div class="gmail_extra">cause NetNameResolver localHostAddress to answer 0 (if host has a set hostname</div><div class="gmail_extra">not being honoured by local DNS servers). Fix falls back to localhost.</div><div>...</div>
<div><br></div><div>Here's the relevant part of the platforms/unix/plugins/SocketPlugin/sqUnixSocket.c change:</div><div><br></div><div class="gmail_extra">-sqInt sqResolverLocalAddress(void) { return nameToAddr(localHostName); }</div>
<div class="gmail_extra">+sqInt sqResolverLocalAddress(void)</div><div class="gmail_extra">+{ sqInt localaddr = nameToAddr(localHostName);</div><div class="gmail_extra">+ if (!localaddr)</div><div class="gmail_extra">
+ localaddr = nameToAddr("localhost");</div><div class="gmail_extra">+ return localaddr;</div><div class="gmail_extra">+}</div><div class="gmail_extra"><br></div><div class="gmail_extra">This fixed several socket tests on my Mac OS box. I think it affects systems behind a broadband router, at least that's how it asffected me on my laptop at home. And here's what is probably the root cause in platforms/unix/plugins/SocketPlugin/sqUnixSocket.c:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">...</div><div class="gmail_extra"><div class="gmail_extra">static char localHostName[MAXHOSTNAMELEN];<br></div><div class="gmail_extra">static u_long localHostAddress; /* GROSS IPv4 ASSUMPTION! */</div>
<div>...</div></div><div><div>/* start a new network session */</div><div><br></div><div>sqInt sqNetworkInit(sqInt resolverSemaIndex)</div><div>{</div><div> if (0 != thisNetSession)</div><div> return 0; /* already initialised */</div>
<div> gethostname(localHostName, MAXHOSTNAMELEN);</div><div> localHostAddress= nameToAddr(localHostName);</div><div> thisNetSession= clock() + time(0);</div><div> if (0 == thisNetSession)</div><div> thisNetSession= 1; /* 0 => uninitialised */</div>
<div> resolverSema= resolverSemaIndex;</div><div> return 0;</div><div>}</div></div><div>...</div><div>and so if gethostname answers something weird, attempts to access localHost are screwed from initialization on.</div>
<div><br></div><div>HTH</div><div>--</div>best,<div>Eliot</div>
</div></div>