[asterisk-bugs] [JIRA] (ASTERISK-26824) websocket and ipv6 is broken

Jørgen H (JIRA) noreply at issues.asterisk.org
Tue Feb 28 04:23:10 CST 2017


Jørgen H created ASTERISK-26824:
-----------------------------------

             Summary: websocket and ipv6 is broken
                 Key: ASTERISK-26824
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26824
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Resources/res_pjsip_transport_websocket
    Affects Versions: 14.3.0
         Environment: linux x64
            Reporter: Jørgen H


The websocket code registers a transport for using 
pjsip_transport_register_type().
This does usually get a type value of 10 (based on index of transport_names array in pjsip).
When a websocket-connection is established using ipv6, the 
pjsip_transport_type_e transport type gets set to 10 + 128(PJSIP_TRANSPORT_IPV6) due to this pjsip-patch: https://trac.pjsip.org/repos/changeset/2746

The code for retrieving the trandsport will fail since there is no transport with type 138, only 10, and asterisk will crash.

There is also a second problem with transport_create() in res/res_pjsip_transport_websocket.c :
The newtransport->transport.key.rem_addr.addr.sa_family is always set to pj_AF_INET() even in ipv6-mode. This will cause code using sockaddrs to not be able to connect to ipv6 ips because the underlying code will create an AF_INET socket instead of AF_INET6.
I commited a change for this in the other wss cleanup ticket https://gerrit.asterisk.org/#/c/4972/5/res/res_pjsip_transport_websocket.c since it is an easy fix.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list