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

Richard Mudgett asteriskteam at digium.com
Wed Aug 22 15:45:46 CDT 2018


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/9984 )

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


Patch Set 4:

(1 comment)

https://gerrit.asterisk.org/#/c/9984/4/res/res_pjsip_transport_websocket.c
File res/res_pjsip_transport_websocket.c:

https://gerrit.asterisk.org/#/c/9984/4/res/res_pjsip_transport_websocket.c@296
PS4, Line 296: 	pj_ansi_strcpy(rdata->pkt_info.src_name, ast_sockaddr_stringify_addr(ast_websocket_remote_address(session)));
> > PJPROJECT might also have a problem converting the IPv6 address to […]
True but that doesn't mean they don't screw up when using it with an IPv6 address.

Out of the 19 places they directly reference the string, only one must not have the []'s.  That place is where they set the address for the receive parameter on the Via header.  One place is to determine if it is a private address which doesn't care if there are []'s or not as it can only return true with IPv4 addresses.  All the other places are for log messages where they output the address with a port which should have the []'s so you don't confuse the address with the port; which is admittedly strange but livable.

Asterisk on the other hand has several places where it calls ast_sockaddr_parse() with that string which must have the []'s to function.

Asterisk feeds that string to pjsip_tpmgr_find_local_addr2() in res_hep_pjsip.c which I don' t know if it needs []'s or not.

Asterisk uses that value in log messages with a port just like PJPROJECT.


All of this is saying that to change Asterisk to properly use the string without [] everywhere is going to be rather invasive.



-- 
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: comment
Gerrit-Change-Id: I8ea9d289901b837512bee2ca2535e3dc14f04d77
Gerrit-Change-Number: 9984
Gerrit-PatchSet: 4
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>
Gerrit-Comment-Date: Wed, 22 Aug 2018 20:45:46 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180822/f89f9870/attachment.html>


More information about the asterisk-code-review mailing list