lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Tue, Mar 22, 2011 at 11:16:19AM +0100, Axel Kittenberger wrote:
> > You mean you can foresee a situation in which getaddrinfo would return
> > an IPv6 as the preferred resolved address and yet your program would
> > rather stick to the IPv4 address returned by gethostbyname, even if
> > the IPv6 route connects successfully?
> Sure, We have cases of websites resolving into IPv6 as default, and
> the client configured to use local IPv6 (like Apple) but the route not
> fully support v6. This results in a long timeout, until the
> connections falls back to IPv4. The usual solution until we get the
> whole campus network to support v6 is to disable v6 on the client. Not
> sure if this is a problem to be solved in whatever Lua Application as
> to get the SysAdmin to correctly configure v6 only if it is fully
> supported by the network.

To be fair, the host shouldn't attempt to connect over IPv6 (or should fail
very very fast) if it lacks appropriate addresses and routes.  If the local
network is advertising an IPv6 router then it's the fault of the local network
admin that the connect doesn't work/fail-rapidly.  If you have a network where
"long timeout" is a common failure mode, you probably need to consider
disabling the IPv6 router adverts until you can fix it.

However, yes, having the facility to lock down to ipv4 (or ipv6) only is
important.  Consider that most tools have a "-4" "--4" "-6" or "--6" set of
options to do just that.  As was suggested in another mail; simply having a set
of flags to pass to connect() would be perfect.


Daniel Silverstone               
PGP mail accepted and encouraged.            Key Id: 3CCE BABE 206C 3B69