pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
audio/pulseaudio add -inet6 option
Hi,
I've prepared a diff (attached) to add support for disabling inet6 in
audio/pulseaudio. A couple of the patch files are modified and some added,
plus the addition in options.mk.
I have a question about the modifying of patch files. I notice that a
couple of already existing files (-ah and -al) refer to the same file. Is
this normal, and should I do that also to keep the 'inet6' patches
separate?
I'm attempting also to send it upstream (but the list is moderated so my
message is waiting for approval - if no response in a few days I'll
subscribe and try again) because my ac.fu is weak and I don't know how to
add this to configure.ac. Well, I managed to add the "-disable-ipv6"
option (see below) but I don't see how to add "-DINET6" to the makefiles.
That doesn't really matter for pkgsrc but I'll hold off until I hear that
they don't want it structured differently.
apart from this, does it look ok?
regards,
iain
--- configure.ac.orig 2009-01-12 23:44:27.000000000 +0000
+++ configure.ac 2009-02-07 19:57:44.000000000 +0000
@@ -1000,6 +1000,26 @@
AC_SUBST(HAVE_POLKIT)
AM_CONDITIONAL([HAVE_POLKIT], [test "x$HAVE_POLKIT" = x1])
+### IPv6 connection support (optional) ###
+
+AC_ARG_ENABLE([ipv6],
+ AS_HELP_STRING([--disable-ipv6],[Disable optional IPv6 support]),
+ [
+ case "$(enableval}" in
+ yes) ipv6=yes ;;
+ no) ipv6=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-ipv6) ;;
+ esac
+ ],
+ [ipv6=auto])
+
+if test "x${ipv6}" != xno ; then
+ AC_DEFINE([INET6], 1, Enable IPv6 connection support)
+ HAVE_IPV6=1
+else
+ HAVE_IPV6=0
+fi
+
### Build and Install man pages ###
AC_ARG_ENABLE(manpages,
AS_HELP_STRING([--disable-manpages],[Disable building and installation
of man pages]),
@@ -1201,6 +1221,11 @@
ENABLE_POLKIT=yes
fi
+ENABLE_IPV6=no
+if test "x${HAVE_IPV6}" = "x1" ; then
+ ENABLE_IPV6=yes
+fi
+
ENABLE_PER_USER_ESOUND_SOCKET=no
if test "x$per_user_esound_socket" = "x1" ; then
ENABLE_PER_USER_ESOUND_SOCKET=yes
@@ -1232,6 +1257,7 @@
Enable TCP Wrappers: ${ENABLE_TCPWRAP}
Enable libsamplerate: ${ENABLE_LIBSAMPLERATE}
Enable PolicyKit: ${ENABLE_POLKIT}
+ Enable IPv6: ${ENABLE_IPV6}
System User: ${PA_SYSTEM_USER}
System Group: ${PA_SYSTEM_GROUP}
Realtime Group: ${PA_REALTIME_GROUP}
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/audio/pulseaudio/distinfo,v
retrieving revision 1.14
diff -u -r1.14 distinfo
--- distinfo 5 Feb 2009 21:05:07 -0000 1.14
+++ distinfo 8 Feb 2009 14:42:02 -0000
@@ -7,15 +7,24 @@
SHA1 (patch-ab) = b894cf1797a2f02e8131be8abc8250774bfec1ec
SHA1 (patch-ac) = 877f1dd615129aa7396fd3dc142474f2795fa802
SHA1 (patch-ad) = 60caf8bc41504fc035a7264ff3c32a4b19da0645
-SHA1 (patch-ae) = 1cd31d18c133fdd5e8db59be319ba5b7a45fe0fe
+SHA1 (patch-ae) = ddddb87351e80e957614a23b5726f9ba1afb8090
SHA1 (patch-af) = 31b8564cb91aabb5de5490659e77de984fd1920b
SHA1 (patch-ag) = 67e3330c52c605e1eec505166e4ceed1a1277b11
SHA1 (patch-ah) = 13cee1dc10be17f51978208843048ba9db7d9a3f
SHA1 (patch-ai) = b8e9e2dee9d1c5d9de488cfa0d06440eedacb7c6
-SHA1 (patch-aj) = 50edf909d5d7cc35e925685cdf0831e73d06f6ec
+SHA1 (patch-aj) = 041a6f9d03834322c91f3a6fcc1327cbd2677b79
SHA1 (patch-ak) = 2a2f80a2ab4b30f2daaebdb1ad0bcb54345743cd
SHA1 (patch-al) = 26999d41484421c0995282045783e3c9df36d4d4
SHA1 (patch-am) = 402dfc10280ec2b6a45781ad6d7b0daa89e2ae34
+SHA1 (patch-an) = d391d3417cf08921b58798e70d1260453cf38b46
+SHA1 (patch-ao) = 292e7d679f4261302335c70697d5885a4f7d7423
+SHA1 (patch-ap) = e2cdaa6c2f63d666ffbfb5ae0184b55ee860ce02
+SHA1 (patch-aq) = 40d1933b67ee395a2d87e7fe6f8a182190730ad7
+SHA1 (patch-ar) = 2c86ae1b0579eee6d1e212787ffe438b5cb4147c
+SHA1 (patch-as) = 3506bbdba7d080b3e79c27a8da1c26ad357a9150
+SHA1 (patch-at) = 481720352089afcfabd252ac80b68ba15f87187d
+SHA1 (patch-au) = 90fb92e7e65409ced8cd8cf9bb5e9f01b0a2ab42
+SHA1 (patch-av) = aa3e4b4775db3a2415ac0f0a6fc2a4c196b09a6d
SHA1 (patch-ba) = da9742d49ecb409cd13bee4468e64f982c03cffe
SHA1 (patch-bb) = ae0209dac352df7abfcf66c452f2ebb91e35e42a
SHA1 (patch-ca) = 75eef8955fa368a144b9e55258389332a177ed6c
Index: options.mk
===================================================================
RCS file: /cvsroot/pkgsrc/audio/pulseaudio/options.mk,v
retrieving revision 1.1
diff -u -r1.1 options.mk
--- options.mk 25 Jan 2009 16:56:01 -0000 1.1
+++ options.mk 8 Feb 2009 14:42:02 -0000
@@ -1,8 +1,8 @@
# $NetBSD: options.mk,v 1.1 2009/01/25 16:56:01 tron Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.pulseaudio
-PKG_SUPPORTED_OPTIONS= avahi
-PKG_SUGGESTED_OPTIONS= avahi
+PKG_SUPPORTED_OPTIONS= avahi inet6
+PKG_SUGGESTED_OPTIONS= avahi inet6
PLIST_VARS+= ${PKG_SUPPORTED_OPTIONS}
.include "../../mk/bsd.options.mk"
@@ -15,3 +15,10 @@
.else
CONFIGURE_ARGS+= --disable-avahi
.endif
+
+###
+### Support IPv6 connections
+###
+.if !empty(PKG_OPTIONS:Minet6)
+CPPFLAGS+= -DINET6
+.endif
Index: patches/patch-ae
===================================================================
RCS file: /cvsroot/pkgsrc/audio/pulseaudio/patches/patch-ae,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 patch-ae
--- patches/patch-ae 18 Dec 2008 14:42:56 -0000 1.1.1.1
+++ patches/patch-ae 8 Feb 2009 14:42:02 -0000
@@ -1,8 +1,34 @@
$NetBSD: patch-ae,v 1.1.1.1 2008/12/18 14:42:56 jmcneill Exp $
---- src/pulsecore/socket-util.c.orig 2008-12-18 00:53:11.000000000 -0500
+--- src/pulsecore/socket-util.c.orig 2009-02-08 13:16:34.000000000 +0000
+++ src/pulsecore/socket-util.c
-@@ -202,9 +202,11 @@ void pa_make_udp_socket_low_delay(int fd
+@@ -93,7 +93,9 @@ void pa_socket_peer_to_string(int fd, ch
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in in;
++#ifdef INET6
+ 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, ch
+ ip & 0xFF,
+ ntohs(sa.in.sin_port));
+ return;
++#ifdef INET6
+ } 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, ch
+ 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");
+@@ -202,9 +206,11 @@ void pa_make_udp_socket_low_delay(int fd
}
int pa_socket_set_rcvbuf(int fd, size_t l) {
@@ -15,7 +41,7 @@
pa_log_warn("SO_RCVBUF: %s", pa_cstrerror(errno));
return -1;
}
-@@ -213,9 +215,11 @@ int pa_socket_set_rcvbuf(int fd, size_t
+@@ -213,9 +219,11 @@ int pa_socket_set_rcvbuf(int fd, size_t
}
int pa_socket_set_sndbuf(int fd, size_t l) {
@@ -28,3 +54,24 @@
pa_log("SO_SNDBUF: %s", pa_cstrerror(errno));
return -1;
}
+@@ -294,8 +302,10 @@ pa_bool_t pa_socket_address_is_local(con
+ case AF_INET:
+ return ((const struct sockaddr_in*) sa)->sin_addr.s_addr ==
INADDR_LOOPBACK;
+
++#ifdef INET6
+ case AF_INET6:
+ return memcmp(&((const struct sockaddr_in6*) sa)->sin6_addr,
&in6addr_loopback, sizeof(struct in6_addr)) == 0;
++#endif
+
+ default:
+ return FALSE;
+@@ -307,7 +317,9 @@ pa_bool_t pa_socket_is_local(int fd) {
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in in;
++#ifdef INET6
+ struct sockaddr_in6 in6;
++#endif
+ #ifdef HAVE_SYS_UN_H
+ struct sockaddr_un un;
+ #endif
Index: patches/patch-aj
===================================================================
RCS file: /cvsroot/pkgsrc/audio/pulseaudio/patches/patch-aj,v
retrieving revision 1.1
diff -u -r1.1 patch-aj
--- patches/patch-aj 23 Dec 2008 02:15:27 -0000 1.1
+++ patches/patch-aj 8 Feb 2009 14:42:02 -0000
@@ -1,7 +1,7 @@
$NetBSD: patch-aj,v 1.1 2008/12/23 02:15:27 hasso Exp $
---- src/modules/rtp/sap.c.orig 2008-12-22 00:52:17 +0200
-+++ src/modules/rtp/sap.c 2008-12-22 00:52:43 +0200
+--- src/modules/rtp/sap.c.orig 2009-02-08 13:15:46.000000000 +0000
++++ src/modules/rtp/sap.c
@@ -38,6 +38,10 @@
#include <sys/filio.h>
#endif
@@ -13,3 +13,37 @@
#include <pulse/xmalloc.h>
#include <pulsecore/core-error.h>
+@@ -83,18 +87,31 @@ int pa_sap_send(pa_sap_context *c, pa_bo
+ return -1;
+ }
+
++#ifdef INET6
+ pa_assert(sa->sa_family == AF_INET || sa->sa_family == AF_INET6);
++#else
++ pa_assert(sa->sa_family == AF_INET);
++#endif
+
+ header = htonl(((uint32_t) 1 << 29) |
++#ifdef INET6
+ (sa->sa_family == AF_INET6 ? (uint32_t) 1 << 28 : 0) |
++#endif
+ (goodbye ? (uint32_t) 1 << 26 : 0) |
+ (c->msg_id_hash));
+
+ iov[0].iov_base = &header;
+ iov[0].iov_len = sizeof(header);
+
+- iov[1].iov_base = sa->sa_family == AF_INET ? (void*) &((struct
sockaddr_in*) sa)->sin_addr : (void*) &((struct sockaddr_in6*) sa)->sin6_addr;
+- iov[1].iov_len = sa->sa_family == AF_INET ? 4U : 16U;
++ if (sa->sa_family == AF_INET) {
++ iov[1].iov_base = (void*) &((struct sockaddr_in*) sa)->sin_addr;
++ iov[1].iov_len = 4U;
++#ifdef INET6
++ } else {
++ iov[1].iov_base = (void*) &((struct sockaddr_in6*) sa)->sin6_addr;
++ iov[1].iov_len = 16U;
++#endif
++ }
+
+ iov[2].iov_base = (char*) MIME_TYPE;
+ iov[2].iov_len = sizeof(MIME_TYPE);
Index: patches/patch-an
===================================================================
RCS file: patches/patch-an
diff -N patches/patch-an
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-an 8 Feb 2009 14:42:02 -0000
@@ -0,0 +1,53 @@
+$NetBSD$
+
+--- src/modules/rtp/module-rtp-recv.c.orig 2009-01-12 23:10:34.000000000
+0000
++++ src/modules/rtp/module-rtp-recv.c
+@@ -373,11 +373,13 @@ static int mcast_socket(const struct soc
+ memset(&mr4, 0, sizeof(mr4));
+ mr4.imr_multiaddr = ((const struct sockaddr_in*) sa)->sin_addr;
+ r = setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mr4, sizeof(mr4));
++#ifdef INET6
+ } else {
+ struct ipv6_mreq mr6;
+ memset(&mr6, 0, sizeof(mr6));
+ mr6.ipv6mr_multiaddr = ((const struct sockaddr_in6*) sa)->sin6_addr;
+ r = setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mr6, sizeof(mr6));
++#endif
+ }
+
+ if (r < 0) {
+@@ -608,7 +610,9 @@ int pa__init(pa_module*m) {
+ struct userdata *u;
+ pa_modargs *ma = NULL;
+ struct sockaddr_in sa4;
++#ifdef INET6
+ struct sockaddr_in6 sa6;
++#endif
+ struct sockaddr *sa;
+ socklen_t salen;
+ const char *sap_address;
+@@ -624,16 +628,18 @@ int pa__init(pa_module*m) {
+
+ sap_address = pa_modargs_get_value(ma, "sap_address",
DEFAULT_SAP_ADDRESS);
+
+- if (inet_pton(AF_INET6, sap_address, &sa6.sin6_addr) > 0) {
+- sa6.sin6_family = AF_INET6;
+- sa6.sin6_port = htons(SAP_PORT);
+- sa = (struct sockaddr*) &sa6;
+- salen = sizeof(sa6);
+- } else if (inet_pton(AF_INET, sap_address, &sa4.sin_addr) > 0) {
++ if (inet_pton(AF_INET, sap_address, &sa4.sin_addr) > 0) {
+ sa4.sin_family = AF_INET;
+ sa4.sin_port = htons(SAP_PORT);
+ sa = (struct sockaddr*) &sa4;
+ salen = sizeof(sa4);
++#ifdef INET6
++ } else if (inet_pton(AF_INET6, sap_address, &sa6.sin6_addr) > 0) {
++ sa6.sin6_family = AF_INET6;
++ sa6.sin6_port = htons(SAP_PORT);
++ sa = (struct sockaddr*) &sa6;
++ salen = sizeof(sa6);
++#endif
+ } else {
+ pa_log("Invalid SAP address '%s'", sap_address);
+ goto fail;
Index: patches/patch-ao
===================================================================
RCS file: patches/patch-ao
diff -N patches/patch-ao
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-ao 8 Feb 2009 14:42:02 -0000
@@ -0,0 +1,94 @@
+$NetBSD$
+
+--- src/modules/rtp/module-rtp-send.c.orig 2009-01-12 23:11:38.000000000
+0000
++++ src/modules/rtp/module-rtp-send.c
+@@ -177,7 +177,9 @@ int pa__init(pa_module*m) {
+ pa_sample_spec ss;
+ pa_channel_map cm;
+ struct sockaddr_in sa4, sap_sa4;
++#ifdef INET6
+ struct sockaddr_in6 sa6, sap_sa6;
++#endif
+ struct sockaddr_storage sa_dst;
+ pa_source_output *o = NULL;
+ uint8_t payload;
+@@ -247,16 +249,18 @@ int pa__init(pa_module*m) {
+
+ dest = pa_modargs_get_value(ma, "destination", DEFAULT_DESTINATION);
+
+- if (inet_pton(AF_INET6, dest, &sa6.sin6_addr) > 0) {
+- sa6.sin6_family = af = AF_INET6;
+- sa6.sin6_port = htons((uint16_t) port);
+- sap_sa6 = sa6;
+- sap_sa6.sin6_port = htons(SAP_PORT);
+- } else if (inet_pton(AF_INET, dest, &sa4.sin_addr) > 0) {
++ if (inet_pton(AF_INET, dest, &sa4.sin_addr) > 0) {
+ sa4.sin_family = af = AF_INET;
+ sa4.sin_port = htons((uint16_t) port);
+ sap_sa4 = sa4;
+ sap_sa4.sin_port = htons(SAP_PORT);
++#ifdef INET6
++ } else if (inet_pton(AF_INET6, dest, &sa6.sin6_addr) > 0) {
++ sa6.sin6_family = af = AF_INET6;
++ sa6.sin6_port = htons((uint16_t) port);
++ sap_sa6 = sa6;
++ sap_sa6.sin6_port = htons(SAP_PORT);
++#endif
+ } else {
+ pa_log("Invalid destination '%s'", dest);
+ goto fail;
+@@ -267,9 +271,14 @@ int pa__init(pa_module*m) {
+ goto fail;
+ }
+
+- if (connect(fd, af == AF_INET ? (struct sockaddr*) &sa4 : (struct
sockaddr*) &sa6, (socklen_t) (af == AF_INET ? sizeof(sa4) : sizeof(sa6))) < 0) {
++ if (af == AF_INET && connect(fd, (struct sockaddr*) &sa4, sizeof(sa4)) <
0) {
+ pa_log("connect() failed: %s", pa_cstrerror(errno));
+ goto fail;
++#ifdef INET6
++ } else if (connect(fd, (struct sockaddr*) &sa6, sizeof(sa6)) < 0) {
++ pa_log("connect() failed: %s", pa_cstrerror(errno));
++ goto fail;
++#endif
+ }
+
+ if ((sap_fd = socket(af, SOCK_DGRAM, 0)) < 0) {
+@@ -277,9 +286,14 @@ int pa__init(pa_module*m) {
+ goto fail;
+ }
+
+- if (connect(sap_fd, af == AF_INET ? (struct sockaddr*) &sap_sa4 : (struct
sockaddr*) &sap_sa6, (socklen_t) (af == AF_INET ? sizeof(sap_sa4) :
sizeof(sap_sa6))) < 0) {
++ if (af == AF_INET && connect(sap_fd, (struct sockaddr*) &sap_sa4,
sizeof(sap_sa4)) < 0) {
++ pa_log("connect() failed: %s", pa_cstrerror(errno));
++ goto fail;
++#ifdef INET6
++ } else if (connect(sap_fd, (struct sockaddr*) &sap_sa6, sizeof(sap_sa6))
< 0) {
+ pa_log("connect() failed: %s", pa_cstrerror(errno));
+ goto fail;
++#endif
+ }
+
+ j = !!loop;
+@@ -357,10 +371,19 @@ int pa__init(pa_module*m) {
+
+ n = pa_sprintf_malloc("PulseAudio RTP Stream on %s", pa_get_fqdn(hn,
sizeof(hn)));
+
+- p = pa_sdp_build(af,
+- af == AF_INET ? (void*) &((struct sockaddr_in*)
&sa_dst)->sin_addr : (void*) &((struct sockaddr_in6*) &sa_dst)->sin6_addr,
+- af == AF_INET ? (void*) &sa4.sin_addr : (void*)
&sa6.sin6_addr,
++ if (af == AF_INET) {
++ p = pa_sdp_build(af,
++ (void*) &((struct sockaddr_in*) &sa_dst)->sin_addr,
++ (void*) &sa4.sin_addr,
+ n, (uint16_t) port, payload, &ss);
++#ifdef INET6
++ } else {
++ p = pa_sdp_build(af,
++ (void*) &((struct sockaddr_in6*) &sa_dst)->sin6_addr,
++ (void*) &sa6.sin6_addr,
++ n, (uint16_t) port, payload, &ss);
++#endif
++ }
+
+ pa_xfree(n);
+
Index: patches/patch-ap
===================================================================
RCS file: patches/patch-ap
diff -N patches/patch-ap
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-ap 8 Feb 2009 14:42:02 -0000
@@ -0,0 +1,33 @@
+$NetBSD$
+
+--- src/modules/rtp/sdp.c.orig 2009-01-12 23:10:34.000000000 +0000
++++ src/modules/rtp/sdp.c
+@@ -48,7 +48,12 @@ char *pa_sdp_build(int af, const void *s
+
+ pa_assert(src);
+ pa_assert(dst);
++
++#ifdef INET6
+ pa_assert(af == AF_INET || af == AF_INET6);
++#else
++ pa_assert(af == AF_INET);
++#endif
+
+ pa_assert_se(f = pa_rtp_format_to_string(ss->format));
+
+@@ -162,6 +167,7 @@ pa_sdp_info *pa_sdp_parse(const char *t,
+ ((struct sockaddr_in*) &i->sa)->sin_family = AF_INET;
+ ((struct sockaddr_in*) &i->sa)->sin_port = 0;
+ i->salen = sizeof(struct sockaddr_in);
++#ifdef INET6
+ } else if (pa_startswith(t, "c=IN IP6 ")) {
+ char a[64];
+ size_t k;
+@@ -179,6 +185,7 @@ pa_sdp_info *pa_sdp_parse(const char *t,
+ ((struct sockaddr_in6*) &i->sa)->sin6_family = AF_INET6;
+ ((struct sockaddr_in6*) &i->sa)->sin6_port = 0;
+ i->salen = sizeof(struct sockaddr_in6);
++#endif
+ } else if (pa_startswith(t, "m=audio ")) {
+
+ if (i->payload > 127) {
Index: patches/patch-aq
===================================================================
RCS file: patches/patch-aq
diff -N patches/patch-aq
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-aq 8 Feb 2009 14:42:02 -0000
@@ -0,0 +1,30 @@
+$NetBSD$
+
+--- src/pulsecore/inet_ntop.c.orig 2009-01-12 23:10:34.000000000 +0000
++++ 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 INET6
+ struct in6_addr *in6 = (struct in6_addr*)src;
++#endif
+
+ assert(src && dst);
+
+@@ -57,6 +59,7 @@ const char *inet_ntop(int af, const void
+ (int)(in->s_addr >> 24) & 0xff);
+ #endif
+ break;
++#ifdef INET6
+ 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
+ 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;
Index: patches/patch-ar
===================================================================
RCS file: patches/patch-ar
diff -N patches/patch-ar
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-ar 8 Feb 2009 14:42:02 -0000
@@ -0,0 +1,25 @@
+$NetBSD$
+
+--- src/pulsecore/inet_pton.c.orig 2009-01-12 23:10:34.000000000 +0000
++++ src/pulsecore/inet_pton.c
+@@ -38,7 +38,9 @@
+
+ int inet_pton(int af, const char *src, void *dst) {
+ struct in_addr *in = (struct in_addr*)dst;
++#ifdef INET6
+ struct in6_addr *in6 = (struct in6_addr*)dst;
++#endif
+
+ assert(src && dst);
+
+@@ -48,8 +50,10 @@ int inet_pton(int af, const char *src, v
+ if (in->s_addr == INADDR_NONE)
+ return 0;
+ break;
++#ifdef INET6
+ case AF_INET6:
+ /* FIXME */
++#endif
+ default:
+ errno = EAFNOSUPPORT;
+ return -1;
Index: patches/patch-as
===================================================================
RCS file: patches/patch-as
diff -N patches/patch-as
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-as 8 Feb 2009 14:42:02 -0000
@@ -0,0 +1,57 @@
+$NetBSD$
+
+--- src/pulsecore/ipacl.c.orig 2009-01-12 23:10:34.000000000 +0000
++++ src/pulsecore/ipacl.c
+@@ -109,6 +109,7 @@ pa_ip_acl* pa_ip_acl_new(const char *s)
+ if (e.bits < 32 && (uint32_t) (ntohl(e.address_ipv4.s_addr) <<
e.bits) != 0)
+ pa_log_warn("Host part of ACL entry '%s/%u' is not zero!", a,
e.bits);
+
++#ifdef INET6
+ } else if (inet_pton(AF_INET6, a, &e.address_ipv6) > 0) {
+
+ e.bits = bits == (uint32_t) -1 ? 128 : (int) bits;
+@@ -138,6 +139,7 @@ pa_ip_acl* pa_ip_acl_new(const char *s)
+ if (t)
+ pa_log_warn("Host part of ACL entry '%s/%u' is not
zero!", a, e.bits);
+ }
++#endif
+
+ } else {
+ pa_log_warn("Failed to parse address: %s", a);
+@@ -183,14 +185,20 @@ int pa_ip_acl_check(pa_ip_acl *acl, int
+ if (getpeername(fd, (struct sockaddr*) &sa, &salen) < 0)
+ return -1;
+
++#ifdef INET6
+ if (sa.ss_family != AF_INET && sa.ss_family != AF_INET6)
++#else
++ if (sa.ss_family != AF_INET)
++#endif
+ return -1;
+
+ if (sa.ss_family == AF_INET && salen != sizeof(struct sockaddr_in))
+ return -1;
+
++#ifdef INET6
+ if (sa.ss_family == AF_INET6 && salen != sizeof(struct sockaddr_in6))
+ return -1;
++#endif
+
+ for (e = acl->entries; e; e = e->next) {
+
+@@ -203,6 +211,7 @@ int pa_ip_acl_check(pa_ip_acl *acl, int
+ if (e->bits == 0 || /* this needs special handling because >>
takes the right-hand side modulo 32 */
+ (ntohl(sai->sin_addr.s_addr ^ e->address_ipv4.s_addr) >> (32
- e->bits)) == 0)
+ return 1;
++#ifdef INET6
+ } else if (e->family == AF_INET6) {
+ int i, bits ;
+ struct sockaddr_in6 *sai = (struct sockaddr_in6*) &sa;
+@@ -230,6 +239,7 @@ int pa_ip_acl_check(pa_ip_acl *acl, int
+ if (bits == 0)
+ return 1;
+ }
++#endif
+ }
+ }
+
Index: patches/patch-at
===================================================================
RCS file: patches/patch-at
diff -N patches/patch-at
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-at 8 Feb 2009 14:42:02 -0000
@@ -0,0 +1,63 @@
+$NetBSD$
+
+--- src/pulsecore/socket-client.c.orig 2009-01-12 23:10:34.000000000 +0000
++++ src/pulsecore/socket-client.c
+@@ -278,7 +278,11 @@ static int sockaddr_prepare(pa_socket_cl
+
+ pa_make_fd_cloexec(c->fd);
+
++#ifdef INET6
+ if (sa->sa_family == AF_INET || sa->sa_family == AF_INET6)
++#else
++ if (sa->sa_family == AF_INET)
++#endif
+ pa_make_tcp_socket_low_delay(c->fd);
+ else
+ pa_make_socket_low_delay(c->fd);
+@@ -353,6 +357,7 @@ void pa_socket_client_set_callback(pa_so
+ c->userdata = userdata;
+ }
+
++#ifdef INET6
+ pa_socket_client* pa_socket_client_new_ipv6(pa_mainloop_api *m, uint8_t
address[16], uint16_t port) {
+ struct sockaddr_in6 sa;
+
+@@ -367,6 +372,7 @@ pa_socket_client* pa_socket_client_new_i
+
+ return pa_socket_client_new_sockaddr(m, (struct sockaddr*) &sa,
sizeof(sa));
+ }
++#endif
+
+ #ifdef HAVE_LIBASYNCNS
+
+@@ -470,7 +476,15 @@ pa_socket_client* pa_socket_client_new_s
+ pa_snprintf(port, sizeof(port), "%u", (unsigned) a.port);
+
+ memset(&hints, 0, sizeof(hints));
+- hints.ai_family = a.type == PA_PARSED_ADDRESS_TCP4 ? PF_INET :
(a.type == PA_PARSED_ADDRESS_TCP6 ? PF_INET6 : PF_UNSPEC);
++ if (a.type == PA_PARSED_ADDRESS_TCP4)
++ hints.ai_family = PF_INET;
++#ifdef INET6
++ else if (a.type == PA_PARSED_ADDRESS_TCP6)
++ hints.ai_family = PF_INET6;
++#endif
++ else
++ hints.ai_family = PF_UNSPEC;
++
+ hints.ai_socktype = SOCK_STREAM;
+
+ #if defined(HAVE_LIBASYNCNS)
+@@ -509,11 +523,13 @@ pa_socket_client* pa_socket_client_new_s
+ struct hostent *host = NULL;
+ struct sockaddr_in s;
+
++#ifdef INET6
+ /* FIXME: PF_INET6 support */
+ if (hints.ai_family == PF_INET6) {
+ pa_log_error("IPv6 is not supported on Windows");
+ goto finish;
+ }
++#endif
+
+ host = gethostbyname(a.path_or_host);
+ if (!host) {
Index: patches/patch-au
===================================================================
RCS file: patches/patch-au
diff -N patches/patch-au
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-au 8 Feb 2009 14:42:02 -0000
@@ -0,0 +1,52 @@
+$NetBSD$
+
+--- src/pulsecore/socket-server.c.orig 2009-01-12 23:10:34.000000000 +0000
++++ src/pulsecore/socket-server.c
+@@ -289,6 +289,7 @@ fail:
+ return NULL;
+ }
+
++#ifdef INET6
+ pa_socket_server* pa_socket_server_new_ipv6(pa_mainloop_api *m, const uint8_t
address[16], uint16_t port, const char *tcpwrap_service) {
+ pa_socket_server *ss;
+ int fd = -1;
+@@ -347,6 +348,7 @@ fail:
+
+ return NULL;
+ }
++#endif
+
+ pa_socket_server* pa_socket_server_new_ipv4_loopback(pa_mainloop_api *m,
uint16_t port, const char *tcpwrap_service) {
+ pa_assert(m);
+@@ -389,6 +391,7 @@ pa_socket_server* pa_socket_server_new_i
+ return NULL;
+ }
+
++#ifdef INET6
+ pa_socket_server* pa_socket_server_new_ipv6_string(pa_mainloop_api *m, const
char *name, uint16_t port, const char *tcpwrap_service) {
+ struct in6_addr ipv6;
+
+@@ -401,6 +404,7 @@ pa_socket_server* pa_socket_server_new_i
+
+ return NULL;
+ }
++#endif
+
+ static void socket_server_free(pa_socket_server*s) {
+ pa_assert(s);
+@@ -441,6 +445,7 @@ char *pa_socket_server_get_address(pa_so
+ pa_assert(l > 0);
+
+ switch (s->type) {
++#ifdef INET6
+ case SOCKET_SERVER_IPV6: {
+ struct sockaddr_in6 sa;
+ socklen_t sa_len = sizeof(sa);
+@@ -476,6 +481,7 @@ char *pa_socket_server_get_address(pa_so
+
+ return c;
+ }
++#endif
+
+ case SOCKET_SERVER_IPV4: {
+ struct sockaddr_in sa;
Index: patches/patch-av
===================================================================
RCS file: patches/patch-av
diff -N patches/patch-av
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-av 8 Feb 2009 14:42:02 -0000
@@ -0,0 +1,30 @@
+$NetBSD$
+
+--- src/tests/ipacl-test.c.orig 2009-01-12 23:10:34.000000000 +0000
++++ src/tests/ipacl-test.c
+@@ -30,7 +30,9 @@
+
+ int main(int argc, char *argv[]) {
+ struct sockaddr_in sa;
++#ifdef INET6
+ struct sockaddr_in6 sa6;
++#endif
+ int fd;
+ int r;
+ pa_ip_acl *acl;
+@@ -87,6 +89,7 @@ int main(int argc, char *argv[]) {
+
+ close(fd);
+
++#ifdef INET6
+ fd = socket(PF_INET6, SOCK_STREAM, 0);
+ assert(fd >= 0);
+
+@@ -129,6 +132,7 @@ int main(int argc, char *argv[]) {
+ pa_ip_acl_free(acl);
+
+ close(fd);
++#endif
+
+ return 0;
+ }
Home |
Main Index |
Thread Index |
Old Index