]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/socket-util.c
Merge commit 'elmarco/bluetooth-fixes'
[pulseaudio] / src / pulsecore / socket-util.c
index a0920025771881fbd3c9ef52ca6b91603d9935b6..5fd5dd6763266ce79b7daada12eb95131064b45f 100644 (file)
@@ -7,7 +7,7 @@
 
   PulseAudio is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as published
-  by the Free Software Foundation; either version 2 of the License,
+  by the Free Software Foundation; either version 2.1 of the License,
   or (at your option) any later version.
 
   PulseAudio is distributed in the hope that it will be useful, but
@@ -93,7 +93,9 @@ void pa_socket_peer_to_string(int fd, char *c, size_t l) {
         union {
             struct sockaddr sa;
             struct sockaddr_in in;
+#ifdef HAVE_IPV6
             struct sockaddr_in6 in6;
+#endif
 #ifdef HAVE_SYS_UN_H
             struct sockaddr_un un;
 #endif
@@ -112,6 +114,7 @@ void pa_socket_peer_to_string(int fd, char *c, size_t l) {
                             ip & 0xFF,
                             ntohs(sa.in.sin_port));
                 return;
+#ifdef HAVE_IPV6
             } else if (sa.sa.sa_family == AF_INET6) {
                 char buf[INET6_ADDRSTRLEN];
                 const char *res;
@@ -121,6 +124,7 @@ void pa_socket_peer_to_string(int fd, char *c, size_t l) {
                     pa_snprintf(c, l, "TCP/IP client from [%s]:%u", buf, ntohs(sa.in6.sin6_port));
                     return;
                 }
+#endif
 #ifdef HAVE_SYS_UN_H
             } else if (sa.sa.sa_family == AF_UNIX) {
                 pa_snprintf(c, l, "UNIX socket client");
@@ -298,8 +302,10 @@ pa_bool_t pa_socket_address_is_local(const struct sockaddr *sa) {
         case AF_INET:
             return ((const struct sockaddr_in*) sa)->sin_addr.s_addr == INADDR_LOOPBACK;
 
+#ifdef HAVE_IPV6
         case AF_INET6:
             return memcmp(&((const struct sockaddr_in6*) sa)->sin6_addr, &in6addr_loopback, sizeof(struct in6_addr)) == 0;
+#endif
 
         default:
             return FALSE;
@@ -311,7 +317,9 @@ pa_bool_t pa_socket_is_local(int fd) {
     union {
         struct sockaddr sa;
         struct sockaddr_in in;
+#ifdef HAVE_IPV6
         struct sockaddr_in6 in6;
+#endif
 #ifdef HAVE_SYS_UN_H
         struct sockaddr_un un;
 #endif