[asterisk-dev] [Code Review] IPv6 in Asterisk
Mark Michelson
mmichelson at digium.com
Wed Jul 7 14:08:14 CDT 2010
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/743/#review2342
-----------------------------------------------------------
These comments come from running Asterisk under valgrind and running a few calls. I'll do a bit more tomorrow as well.
/trunk/channels/chan_iax2.c
<https://reviewboard.asterisk.org/r/743/#comment5189>
sin is an output parameter to create_addr() and is typically uninitialized at this point. Calling ast_sockaddr_from_sin() thus causes a bunch of bogus values to be copied into sin_tmp. My suggestion here is to remove the call to ast_sockaddr_from_sin() entirely. Instead, set the address family of sin_tmp and call ast_get_ip_or_srv(). Then use ast_sockaddr_to_sin() to copy sin_tmp's content into sin.
/trunk/channels/chan_iax2.c
<https://reviewboard.asterisk.org/r/743/#comment5185>
You need to set the address family of peer_addr_tmp() before calling ast_dnsmgr_lookup()
/trunk/main/http.c
<https://reviewboard.asterisk.org/r/743/#comment5186>
You need to set the address family of tmp and tmp2 to AF_INET or else ast_sockaddr_from_sin() will complain.
/trunk/main/netsock2.c
<https://reviewboard.asterisk.org/r/743/#comment5187>
There are several pointer errors here.
The memcpy should be:
memcpy(&addr->ss, sin, sizeof(*sin));
and the final line should be:
addr->len = sizeof(*sin);
/trunk/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/743/#comment5188>
There are many places where ast_rtp_instance_get_local_address() and ast_rtp_instance_get_remote_address() are called using uninitialized ast_sockaddr structures. This means that the ast_sockaddr_cmp() call uses the uninitialized values when comparing.
Personally, I don't see the point of doing the comparison. We should just unconditionally set the address.
- Mark
On 2010-07-05 10:24:08, Simon Perreault wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/743/
> -----------------------------------------------------------
>
> (Updated 2010-07-05 10:24:08)
>
>
> Review request for Asterisk Developers and Mark Michelson.
>
>
> Summary
> -------
>
> This is the port of Asterisk to IPv6.
>
>
> This addresses bug 17565.
> https://issues.asterisk.org/view.php?id=17565
>
>
> Diffs
> -----
>
> /trunk/addons/chan_ooh323.c 273566
> /trunk/apps/app_externalivr.c 273566
> /trunk/channels/chan_gtalk.c 273566
> /trunk/channels/chan_h323.c 273566
> /trunk/channels/chan_iax2.c 273566
> /trunk/channels/chan_jingle.c 273566
> /trunk/channels/chan_mgcp.c 273566
> /trunk/channels/chan_multicast_rtp.c 273566
> /trunk/channels/chan_sip.c 273566
> /trunk/channels/chan_skinny.c 273566
> /trunk/channels/chan_unistim.c 273566
> /trunk/channels/sip/dialplan_functions.c 273566
> /trunk/channels/sip/include/dialog.h 273566
> /trunk/channels/sip/include/globals.h 273566
> /trunk/channels/sip/include/reqresp_parser.h 273566
> /trunk/channels/sip/include/sip.h 273566
> /trunk/channels/sip/reqresp_parser.c 273566
> /trunk/include/asterisk/acl.h 273566
> /trunk/include/asterisk/config.h 273566
> /trunk/include/asterisk/dnsmgr.h 273566
> /trunk/include/asterisk/netsock2.h PRE-CREATION
> /trunk/include/asterisk/rtp_engine.h 273566
> /trunk/include/asterisk/tcptls.h 273566
> /trunk/main/acl.c 273566
> /trunk/main/app.c 273566
> /trunk/main/config.c 273566
> /trunk/main/dnsmgr.c 273566
> /trunk/main/http.c 273566
> /trunk/main/manager.c 273566
> /trunk/main/netsock2.c PRE-CREATION
> /trunk/main/rtp_engine.c 273566
> /trunk/main/tcptls.c 273566
> /trunk/res/res_rtp_asterisk.c 273566
> /trunk/res/res_rtp_multicast.c 273566
>
> Diff: https://reviewboard.asterisk.org/r/743/diff
>
>
> Testing
> -------
>
> See test report on the mantis issue.
>
>
> Thanks,
>
> Simon
>
>
More information about the asterisk-dev
mailing list