[Asterisk-code-review] pjproject bundled: Allow IPv4/IPv6 (Dual Stack) configurations. (asterisk[master])
Joshua Colp
asteriskteam at digium.com
Mon Aug 22 09:22:04 CDT 2016
Joshua Colp has submitted this change and it was merged.
Change subject: pjproject_bundled: Allow IPv4/IPv6 (Dual Stack) configurations.
......................................................................
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
---
A third-party/pjproject/patches/0003-r5403-pjsip_IPV6_V6ONLY.patch
1 file changed, 13 insertions(+), 0 deletions(-)
Approvals:
George Joseph: Looks good to me, approved
Joshua Colp: Looks good to me, but someone else must approve; Verified
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 0000000..b324b53
--- /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()) {
--
To view, visit https://gerrit.asterisk.org/3659
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3335d8718f79f4b2feae91b5b005a3ce684a63ae
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
More information about the asterisk-code-review
mailing list