]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Obtain the pri lock for PRI queue counters.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 31 Jan 2011 23:45:58 +0000 (23:45 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 31 Jan 2011 23:45:58 +0000 (23:45 +0000)
Need to obtain the pri lock when calling pri_dump_info_str() to avoid a
reentrancy problem when calculating the Q.921 Q count statistic.

JIRA AST-484

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@305341 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_dahdi.c

index 6fb4da3b2e125f4f32033568be63034236164b4e..a1869dafd2ce23f9b1883167e1fdcadf438b2861 100644 (file)
@@ -10871,6 +10871,7 @@ static int handle_pri_show_span(int fd, int argc, char *argv[])
                        ast_cli(fd, "%s D-channel: %d\n", pri_order(x), pris[span-1].dchannels[x]);
                        build_status(status, sizeof(status), pris[span-1].dchanavail[x], pris[span-1].dchans[x] == pris[span-1].pri);
                        ast_cli(fd, "Status: %s\n", status);
+                       ast_mutex_lock(&pris[span - 1].lock);
 #ifdef PRI_DUMP_INFO_STR
                        info_str = pri_dump_info_str(pris[span-1].pri);
                        if (info_str) {
@@ -10880,6 +10881,7 @@ static int handle_pri_show_span(int fd, int argc, char *argv[])
 #else
                        pri_dump_info(pris[span-1].pri);
 #endif
+                       ast_mutex_unlock(&pris[span - 1].lock);
                        ast_cli(fd, "Overlap Recv: %s\n\n", (pris[span-1].overlapdial & DAHDI_OVERLAPDIAL_INCOMING)?"Yes":"No");
                }
        }