summaryrefslogtreecommitdiff
path: root/main/features.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2011-05-25 16:50:38 +0000
committerRichard Mudgett <rmudgett@digium.com>2011-05-25 16:50:38 +0000
commita42bf8cc9250f875f6d26ca7cd2d81e2ea8821d8 (patch)
tree03a00e37f9e8b6a9e09158cd4c9ed5ce1ab3bb9d /main/features.c
parente789eb8b2d6d3371ef8d82ac61451a52f0768073 (diff)
Merged revisions 320796 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r320796 | rmudgett | 2011-05-25 11:23:11 -0500 (Wed, 25 May 2011) | 17 lines Give zombies a safe channel driver to use. Recent crashes from zombie channels suggests that they need a safe home to goto. When a masquerade happens, the physical part of the zombie channel is hungup. The hangup normally sets the channel private pointer to NULL. If someone then blindly does a callback to the channel driver, a crash is likely because the private pointer is NULL. The masquerade now sets the channel technology of zombie channels to the kill channel driver. Related to the following issues: (issue #19116) (issue #19310) Review: https://reviewboard.asterisk.org/r/1224/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@320820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/features.c')
-rw-r--r--main/features.c53
1 files changed, 5 insertions, 48 deletions
diff --git a/main/features.c b/main/features.c
index 1bb86fc30..e8e9164d3 100644
--- a/main/features.c
+++ b/main/features.c
@@ -478,58 +478,15 @@ struct ast_dial_features {
};
#if defined(ATXFER_NULL_TECH)
-static struct ast_frame *null_read(struct ast_channel *chan)
-{
- /* Hangup channel. */
- return NULL;
-}
-
-static struct ast_frame *null_exception(struct ast_channel *chan)
-{
- /* Hangup channel. */
- return NULL;
-}
-
-static int null_write(struct ast_channel *chan, struct ast_frame *frame)
-{
- /* Hangup channel. */
- return -1;
-}
-
-static int null_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
-{
- /* No problem fixing up the channel. */
- return 0;
-}
-
-static int null_hangup(struct ast_channel *chan)
-{
- chan->tech_pvt = NULL;
- return 0;
-}
-
-static const struct ast_channel_tech null_tech = {
- .type = "NULL",
- .description = "NULL channel driver for atxfer",
- .capabilities = -1,
- .read = null_read,
- .exception = null_exception,
- .write = null_write,
- .fixup = null_fixup,
- .hangup = null_hangup,
-};
-#endif /* defined(ATXFER_NULL_TECH) */
-
-#if defined(ATXFER_NULL_TECH)
/*!
* \internal
- * \brief Set the channel technology to the NULL technology.
+ * \brief Set the channel technology to the kill technology.
*
* \param chan Channel to change technology.
*
* \return Nothing
*/
-static void set_null_chan_tech(struct ast_channel *chan)
+static void set_kill_chan_tech(struct ast_channel *chan)
{
int idx;
@@ -546,8 +503,8 @@ static void set_null_chan_tech(struct ast_channel *chan)
chan->tech_pvt = NULL;
}
- /* Install the NULL technology and wake up anyone waiting on it. */
- chan->tech = &null_tech;
+ /* Install the kill technology and wake up anyone waiting on it. */
+ chan->tech = &ast_kill_tech;
for (idx = 0; idx < AST_MAX_FDS; ++idx) {
switch (idx) {
case AST_ALERT_FD:
@@ -3146,7 +3103,7 @@ static struct ast_channel *feature_request_and_dial(struct ast_channel *caller,
* Get rid of caller's physical technology so it is free for
* other calls.
*/
- set_null_chan_tech(caller);
+ set_kill_chan_tech(caller);
#endif /* defined(ATXFER_NULL_TECH) */
} else {
/* caller is not hungup so monitor it. */