Hi Arkadiusz, by looking at the OpenSSL code I think it supports some legacy platforms which have very limited support. So I prefer not to break them and this is done most easily by by not touching the code for platforms not defining OPENSSL_USE_IPV6.
For OpenSSH thinks might be different, I do not know. I have submitted an initial patch as #2051 which does what you call the ifdef mess, but it should be simple to verify that nothing breaks on legacy platforms. I really only care about the changes affecting the DTLS layer. The changes to s_client and s_server are for testing the stuff for DTLS and TLS. The OpenSSL devteam can use the patch or not, depending on the code style they want. I'll leave the decision up to them. Let's see... Best regards Michael On Sep 24, 2009, at 10:36 AM, Arkadiusz Miskiewicz wrote: > >> 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] > ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [email protected] Automated List Manager [email protected]
