summaryrefslogtreecommitdiff
path: root/third-party
diff options
context:
space:
mode:
authorAlexander Traud <pabstraud@compuserve.com>2016-08-20 18:18:51 +0200
committerAlexander Traud <pabstraud@compuserve.com>2016-08-20 14:25:35 -0500
commitbe38c95def9da61ce31118cc29ea6992a341278f (patch)
tree6d145a1a3b8bbf41e5bf3cb844d0733dbd5818e7 /third-party
parent8778e22b154e45c2b836d3af413620aefc0b4966 (diff)
pjproject_bundled: Allow IPv4/IPv6 (Dual Stack) configurations.
PJProject supports a lot of platforms even Windows, some with different defaults when it comes to IPv6. In many Linux platforms like Ubuntu 16.04 LTS, "/proc/sys/net/ipv6/bindv6only" is set to 0 (false). Different than in Windows. Because of this, if configured with just an IPv6 address/transport, PJProject listens to both IPv4 and IPv6. However, this is not supported by the PJProject team. As consequence, you end-up with IPv4-mapped IPv6 addresses in SDP, incompatible with IPv4-only clients. Technically, you end-up with an IPv6-only server which accepts incoming connections on IPv4. If you try to configure two transports, one with IPv4 and one with IPv6 on the same interface, as expected by the PJProject team, the IPv4 transport is not able to bind because the IPv6 transport listens to both already. One solution would be to change "/proc/sys/net/ipv6/bindv6only" system-wide. Then, you are able to configure two transports, one for each IP version on the same interface. That way, you get a server which works with IPv4 clients and IPv6 clients at the same time over the same interface. Here, this change sets this parameter directly within PJProject to match the expectations of the PJProject team in any case. This allows IPv4/IPv6 Dual Stack servers out of the box like in chan_sip. This change was accepted by the PJProject team as <http://trac.pjsip.org/repos/changeset/5403> and is expected to arrive in the next version, PJProject 2.6.0. Until then, this change is incorporated in the bundled PJProject of Asterisk. ASTERISK-26309 Change-Id: I3335d8718f79f4b2feae91b5b005a3ce684a63ae
Diffstat (limited to 'third-party')
-rw-r--r--third-party/pjproject/patches/0003-r5403-pjsip_IPV6_V6ONLY.patch13
1 files changed, 13 insertions, 0 deletions
diff --git a/third-party/pjproject/patches/0003-r5403-pjsip_IPV6_V6ONLY.patch b/third-party/pjproject/patches/0003-r5403-pjsip_IPV6_V6ONLY.patch
new file mode 100644
index 000000000..b324b53f4
--- /dev/null
+++ b/third-party/pjproject/patches/0003-r5403-pjsip_IPV6_V6ONLY.patch
@@ -0,0 +1,13 @@
+--- a/pjlib/src/pj/sock_bsd.c
++++ b/pjlib/src/pj/sock_bsd.c
+@@ -539,6 +539,10 @@
+ pj_sock_setsockopt(*sock, pj_SOL_SOCKET(), pj_SO_NOSIGPIPE(),
+ &val, sizeof(val));
+ }
++ if (af != PJ_AF_INET) { /* Linux Kernel 2.4.21; June 2003 */
++ pj_sock_setsockopt(*sock, PJ_SOL_IPV6, IPV6_V6ONLY,
++ &val, sizeof(val));
++ }
+ #if defined(PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT) && \
+ PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT!=0
+ if (type == pj_SOCK_DGRAM()) {