[asterisk-dev] [Code Review] build_peer doesnt unlink a peer object from peers_by_ip container which leads to a wrong refcounter value

irroot reviewboard at asterisk.org
Mon Sep 12 05:15:12 CDT 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1428/#review4291
-----------------------------------------------------------

Ship it!


This patch looks good nasty little ref problem and simple fix.

- irroot


On Sept. 12, 2011, 4:09 a.m., schmidts wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1428/
> -----------------------------------------------------------
> 
> (Updated Sept. 12, 2011, 4:09 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> after sip reload every peer was relinked to the peers_by_ip container and the refcounter of each object was increased. after debugging i have found that the ao2_find in build_peer unlinks the peer from the peers container but not from the peers_by_ip container which leads to a wrong refcounter value so the old peer object wasnt destroyed.
> 
> by adding a ao2_unlink from the peers_by_ip container the refcounter is ok and the old peer object is removed.
> 
> 
> Diffs
> -----
> 
>   branches/1.8/channels/chan_sip.c 335252 
> 
> Diff: https://reviewboard.asterisk.org/r/1428/diff
> 
> 
> Testing
> -------
> 
> several sip reloads with 4000 peers, refcounter, refdebug and sip show objects looks fine.
> 
> 
> Thanks,
> 
> schmidts
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110912/9ea0b360/attachment.htm>


More information about the asterisk-dev mailing list