diff options
author | Iain Hibbert <plunky@rya-online.net> | 2009-02-13 21:58:09 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-02-13 21:58:09 +0100 |
commit | dc590c7d0aced673bb395f12f39749b4ac8407fd (patch) | |
tree | 652d6657e3c7f46c9235a5ac0a796dcc1501fa46 /src/pulsecore/inet_ntop.c | |
parent | 9334d900e5f04982f1b55180c15c9e74005d3ea2 (diff) |
Optionally disable IPv6
Closes #79
Diffstat (limited to 'src/pulsecore/inet_ntop.c')
-rw-r--r-- | src/pulsecore/inet_ntop.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pulsecore/inet_ntop.c b/src/pulsecore/inet_ntop.c index 87551232..012a1a05 100644 --- a/src/pulsecore/inet_ntop.c +++ b/src/pulsecore/inet_ntop.c @@ -38,7 +38,9 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt) { struct in_addr *in = (struct in_addr*)src; +#ifdef HAVE_IPV6 struct in6_addr *in6 = (struct in6_addr*)src; +#endif assert(src && dst); @@ -57,6 +59,7 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt) { (int)(in->s_addr >> 24) & 0xff); #endif break; +#ifdef HAVE_IPV6 case AF_INET6: pa_snprintf(dst, cnt, "%x:%x:%x:%x:%x:%x:%x:%x", in6->s6_addr[ 0] << 8 | in6->s6_addr[ 1], @@ -68,6 +71,7 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt) { in6->s6_addr[12] << 8 | in6->s6_addr[13], in6->s6_addr[14] << 8 | in6->s6_addr[15]); break; +#endif default: errno = EAFNOSUPPORT; return NULL; |