Commit a427a151 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud

sip_transport: avoid PJ_ENOTSUITABLE when ipv4<->ipv6

This is a bit a dirty fix, but the ICE transport can use several
sockets or even an IPv4 socket on a side and an IPv6 on the other
side. But, if it's the case, the header sent contains an IPv6
address and sip_transport will return PJ_ENOTSUITABLE because
TLS6 != TLS4.

In this patch, we just ignore the V6 extension.

Change-Id: I3ded796dd6ee95a08ec54656dc2ad8107f0e62e3
Gitlab: #134
parent e4db6294
...@@ -38,6 +38,7 @@ bash -c "%PATCH_CMD% %UNIXPATH%pjproject/rfc6544.patch" ...@@ -38,6 +38,7 @@ bash -c "%PATCH_CMD% %UNIXPATH%pjproject/rfc6544.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/ice_config.patch" bash -c "%PATCH_CMD% %UNIXPATH%pjproject/ice_config.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_first_packet_turn_tcp.patch" bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_first_packet_turn_tcp.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_ebusy_turn.patch" bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_ebusy_turn.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/ignore_ipv6_on_transport_check.patch"
%APPLY_CMD% %SRC%\pjproject\win32_vs_gnutls.patch %APPLY_CMD% %SRC%\pjproject\win32_vs_gnutls.patch
%APPLY_CMD% %SRC%\pjproject\win_config.patch %APPLY_CMD% %SRC%\pjproject\win_config.patch
......
pjsip/src/pjsip/sip_transport.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pjsip/src/pjsip/sip_transport.c b/pjsip/src/pjsip/sip_transport.c
index 1d0e28d32..cd9e462a4 100644
--- a/pjsip/src/pjsip/sip_transport.c
+++ b/pjsip/src/pjsip/sip_transport.c
@@ -2151,7 +2151,9 @@ PJ_DEF(pj_status_t) pjsip_tpmgr_acquire_transport2(pjsip_tpmgr *mgr,
pjsip_transport *seltp = sel->u.transport;
/* See if the transport is (not) suitable */
- if (seltp->key.type != type) {
+ pjsip_transport_type_e type_no_ipv6 = type % PJSIP_TRANSPORT_IPV6;
+ pjsip_transport_type_e key_type_no_ipv6 = seltp->key.type % PJSIP_TRANSPORT_IPV6;
+ if (type_no_ipv6 != key_type_no_ipv6) {
pj_lock_release(mgr->lock);
return PJSIP_ETPNOTSUITABLE;
}
...@@ -67,6 +67,7 @@ endif ...@@ -67,6 +67,7 @@ endif
$(APPLY) $(SRC)/pjproject/sip_config.patch $(APPLY) $(SRC)/pjproject/sip_config.patch
$(APPLY) $(SRC)/pjproject/fix_first_packet_turn_tcp.patch $(APPLY) $(SRC)/pjproject/fix_first_packet_turn_tcp.patch
$(APPLY) $(SRC)/pjproject/fix_ebusy_turn.patch $(APPLY) $(SRC)/pjproject/fix_ebusy_turn.patch
$(APPLY) $(SRC)/pjproject/ignore_ipv6_on_transport_check.patch
$(UPDATE_AUTOCONFIG) $(UPDATE_AUTOCONFIG)
$(MOVE) $(MOVE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment