Summary: | ASTERISK-24871: [patch] build_peer peer mailbox management bug | ||
Reporter: | Gareth Palmer (gareth) | Labels: | patch |
Date Opened: | 2015-03-12 23:11:08 | Date Closed: | |
Priority: | Trivial | Regression? | No |
Status: | Open/New | Components: | Channels/chan_sip/General |
Versions: | SVN 11.16.0 13.18.4 | Frequency of Occurrence | Constant |
Related Issues: | |||
Environment: | Attachments: | ( 0) chan_sip.c.patch | |
Description: | During a reload, {{build_peer}} iterates over the peer's mailboxes and tags them for removal via the {{delme}} variable. It adds any new, unique mailboxes to the peer via {{add_peer_mailboxes}} and then removes any mailboxes with {{delme}} still set.
However, there isn't any code to unset {{delme}}, so this would remove any previously configured mailboxes. That is not what happens though because {{build_peer}} also calls {{set_peer_defaults}} which clears out all of the configured mailboxes using {{clear_peer_mailboxes}} making the setting of {{delme}} redundant. So in the end there is no impact to the user because all the configured mailboxes get added regardless. Patch unsets {{delme}} for existing, still-configured mailboxes in {{add_peer_mailboxes}} and removes call to {{clear_peer_mailboxes}}. | ||
Comments: | By: Corey Farrell (coreyfarrell) 2015-03-13 00:33:48.582-0500 One potential issue, lets say build_peer is called with devstate_only==1. An existing peer is found that was originally build with devstate_only==0 (and it has mailboxes), peer->the_mark==1. Existing code would clear all mailboxes during the call to set_peer_defaults, but build_peer would not repopulate them. The new code would leave the existing mailboxes untouched. By: Rusty Newton (rnewton) 2015-03-13 17:49:50.869-0500 Once you've followed the Code Review process [1] and submitted your code to Review Board [2] be sure to edit this JIRA issue and add the Review Board review URL in the appropriate field. Thanks! [1] https://wiki.asterisk.org/wiki/display/AST/Code+Review [2] https://wiki.asterisk.org/wiki/display/AST/Review+Board+Usage |