]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip: Log IPv6 addresses correctly
authorSean Bright <sean.bright@gmail.com>
Fri, 7 Sep 2018 14:40:05 +0000 (10:40 -0400)
committerSean Bright <sean.bright@gmail.com>
Fri, 14 Sep 2018 19:58:59 +0000 (15:58 -0400)
commitd3c869c736f43e4807e5751b905519b7633ad21d
tree9d0bc2c11dcb7a109355df39195117d437b86b17
parent641e5b7e63826ddccc76df188237d7261a0cbfc7
res_pjsip: Log IPv6 addresses correctly

Both pjsip_tx_data.tp_info.dst_name and pjsip_rx_data.pkt_info.src_name
store IPv6 addresses without enclosing brackets. This causes some log
output to be confusing because it is difficult to separate the IPv6
address from a port specification.

* Use pj_sockaddr_print() along with pjsip_tx_data.tp_info.dst_addr and
  pjsip_rx_data.pkt_info.src_addr where possible for consistent IPv6
  output.

* When a pj_sockaddr is not available, explicitly wrap IPv6 addresses
  in brackets.

* When assigning pjsip_rx_data.pkt_info.src_name ourselves, make sure
  to also set pjsip_rx_data.pkt_info.src_addr.

Change-Id: I5cfe997ced7883862a12b9c7d8551d76ae02fcf8
include/asterisk/netsock2.h
res/res_pjsip.c
res/res_pjsip/pjsip_distributor.c
res/res_pjsip_logger.c
res/res_pjsip_outbound_authenticator_digest.c
res/res_pjsip_session.c
res/res_pjsip_transport_websocket.c