Subject: Detecting if inet_pton supports IPv6

Detecting if inet_pton supports IPv6

From: <codemstr_at_ptd.net>
Date: 2005-04-04

I've run into an issue... Some systems do have inet_pton and inet_net_pton,
but do not support IPv6 in these functions. The OS itself does support IPv6,
meaning socket() succeeds, however, the inet_[net_]pton function does not
support IPv6 address translation.

On the system I'm currently using to test, inet_pton does support AF_INET6,
but inet_net_pton does not. Naturally, this is a big problem for us since
we're trying to provide OS-independent IPv6 support. My question is, how
should we detect this? The only way I know of would be to try calling it with
AF_INET6 and see if it succeeds, however that's not going to work with cross-
compilation. Should we just completely ignore system supplied inet_pton and
inet_net_pton and always use the ones we supply? Or is there some way we can
do this and still maintain cross-compilation support?

Dominick Meglio
_______________________________________________
http://cool.haxx.se/mailman/listinfo/c-ares
Received on Mon Apr 4 03:58:40 2005