[Asterisk-code-review] res pjsip: Correct various misuses of pjsip rx data.pkt info... (asterisk[13])

Sean Bright asteriskteam at digium.com
Wed Aug 22 14:35:22 CDT 2018


Hello Matthew Fredrickson, Richard Mudgett, Jenkins2, George Joseph, Joshua Colp, 

I'd like you to reexamine a change. Please visit

    https://gerrit.asterisk.org/9984

to look at the new patch set (#5).

Change subject: res_pjsip: Correct various misuses of pjsip_rx_data.pkt_info.src_name
......................................................................

res_pjsip: Correct various misuses of pjsip_rx_data.pkt_info.src_name

An assumption is being made about the contents of
pjsip_rx_data.pkt_info.src_name when IPv6 is in use. PJSIP's internal
transports set this field to the raw IP address of the sender of the
packet, which in the case of IPv6 does not contain the delimiting
[brackets].

There are several places where we attempt to use ast_sockaddr_parse()
to parse the src_name, which will fail silently (because we aren't
checking the return value of ast_sockaddr_parse() in many places) for
IPv6 adddresses.

res_pjsip_transport_websocket is incorrectly setting this field to
include the brackets, causing some outgoing header values to be non-
compliant with RFC 3261.

When src_name is populated by the built-in PJSIP transports, the code
uses pj_sockaddr_print() with 'flags' set to 0, meaning that the
brackets are not rendered around IPv6 addresses.

This may be related to ASTERISK~27101.

See also: https://github.com/onsip/SIP.js/pull/594

ASTERISK-28020 #close

Change-Id: I8ea9d289901b837512bee2ca2535e3dc14f04d77
---
M include/asterisk/netsock2.h
M main/netsock2.c
M res/res_pjsip.c
M res/res_pjsip/pjsip_distributor.c
M res/res_pjsip/security_events.c
M res/res_pjsip_acl.c
M res/res_pjsip_endpoint_identifier_ip.c
M res/res_pjsip_transport_websocket.c
8 files changed, 48 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/84/9984/5
-- 
To view, visit https://gerrit.asterisk.org/9984
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8ea9d289901b837512bee2ca2535e3dc14f04d77
Gerrit-Change-Number: 9984
Gerrit-PatchSet: 5
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180822/06cd008b/attachment.html>


More information about the asterisk-code-review mailing list