>I'm also working on IPv6 support (also for the openssl s_client and
>s_server apps). I use code like

>#if OPENSSL_USE_IPV6
>struct sockaddr_storage server, client;
>#else
>struct sockaddr_in server, client;
>#endif

>This should be portable.

It's portable but it makes huge mess in the code.

Take a look at openssh to see how to make ipv6 support in a clean way. 

They always use sockaddr_storage and getaddrinfo. configure tests for 
existence of these in system and if not found then compat headers/library is 
included.

This makes code clean, readable and avoids ugly #if mess. Please follow that 
way.

-- 
Arkadiusz Miƛkiewicz        PLD/Linux Team
arekm / maven.pl            http://ftp.pld-linux.org/
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to