[Asterisk-code-review] res pjsip transport websocket: Properly set src name for IPv6 (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Wed Aug 22 11:53:14 CDT 2018


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

Change subject: res_pjsip_transport_websocket: Properly set src_name for IPv6
......................................................................


Patch Set 4: Code-Review-1

(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)));
This is opening up a can of worms as this string is used throughout PJPROJECT and Asterisk.  Just about everywhere in the projects use the string in such a way that the []'s need to be there.  People are so used to working with IPv4 addresses that when the IPv6 address comes around it is used incorrectly unless there are []'s present.

Examples:
Log messages Log("%s:%d", rdata->pkt_info.src_name, port)

More severely:
ast_sockaddr_parse() in Asterisk needs the []'s to know where the port is in the string for IPv6 addresses since the port is appended to the address with a ':' delimiter which unfortunately is used in IPv6 addresses.

PJPROJECT might also have a problem converting the IPv6 address to a sockaddr unless there are []'s too.  Though that code is confusing enough to defy quick analysis.



-- 
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 16:53:14 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180822/55027bcf/attachment.html>


More information about the asterisk-code-review mailing list