[Asterisk-code-review] chan iax2: Prevent deadlock between hangup and sending lagrq... (asterisk[master])

Richard Mudgett asteriskteam at digium.com
Mon May 18 10:42:19 CDT 2015


Richard Mudgett has posted comments on this change.

Change subject: chan_iax2: Prevent deadlock between hangup and sending lagrq/ping
......................................................................


Patch Set 11:

(1 comment)

https://gerrit.asterisk.org/#/c/169/11/channels/chan_iax2.c
File channels/chan_iax2.c:

Line 2076: 	if (ast_sched_find_data(sched, sched_id)) {
> I didn't understand this. Could you please explain it more?
* ast_sched_find_data() returns the data parameter of the given sched id callback.
* What is the data paremeter to send_ping()?  It is ((void *) callno).
* callno can be 0.  What is NULL? It is 0.

The simple way to avoid passing 0 and thus having the test with ast_sched_find_data() erroneously fail is to encode the send_ping's data parameter as callno + 1.

iaxs[callno]->pingid = iax2_sched_add(sched, timeout, send_ping, (void *)(long) (callno + 1))

send_ping(const void *data)
{
  int callno = ((long) data) - 1;
}


-- 
To view, visit https://gerrit.asterisk.org/169
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I03bec1fc8faacb89630269e935fa667c6d6c080c
Gerrit-PatchSet: 11
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Y Ateya <y.ateya at starkbits.com>
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Y Ateya <y.ateya at starkbits.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list