-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 03.09.12 09:09, schrieb Gert Doering:
> Hi,
>
> On Mon, Sep 03, 2012 at 08:49:42AM +0200, Arne Schwabe wrote:
>> Some BSD need the right salen, max(sizeof(v4),sizeof(v6)) does not
work. Since sa_len is not a member in sockaddr for Linux and Windows and
SA_LEN is no available on Darwin, NetBSD explicitly set salem
>
> "Something sneaked into your keyboard"...
>
>> + getnameinfo(&addr->addr.sa, sizeof (struct sockaddr_in6),
>> + buf, sizeof (buf), NULL, 0, NI_NUMERICHOST);
>
> ... this very much looks like v1 of the patch...? :-)
>
> Anyway, what about defining an openvpn_sa_len() macro that will either
> use SA_LEN() if it exists, or fall back to
>
> #define openvpn_sa_len(addr) ( addr->sa.sa_family == AF_INET?
sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6) )
>
> this will, of course, bite us when we implement IPv8, but should be fine
> for 2.3...

I will try to avoid this for now... I hope to convert openvpn to fully
using getnameinfo/getaddrinfo
one day so that we do not need these deep look into the sockaddr anymore.


> (Is there something magic in Autoconf to solve this? Must be a standard
> problem...)
>
>
I think most people don't deal with raw sockaddr structs. getaddrinfo
returns ai_addrlen.

Arne
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Darwin)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBEWZUACgkQe8+cMNS4zRf5/QCeKPwCJKva6l05i18OWv4tZJFB
BuQAn36NT4DZoi5e9RTqm3XAfBQqiWup
=e27Z
-----END PGP SIGNATURE-----

Reply via email to