aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-19 15:53:15 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-19 15:53:15 +0000
commitff4d4acd9ca29349b55471369ecd6f6e08550086 (patch)
tree84ba478518d357aed6290ee077a15c0373796c31 /channels/chan_iax2.c
parent60d49dfcac7c7ad453f1101a3d386a656d9f4876 (diff)
Merged revisions 75927 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r75927 | russell | 2007-07-19 10:49:42 -0500 (Thu, 19 Jul 2007) | 6 lines When processing full frames, take sequence number wraparound into account when deciding whether or not we need to request retransmissions by sending a VNAK. This code could cause VNAKs to be sent erroneously in some cases, and to not be sent in other cases when it should have been. (closes issue #10237, reported and patched by mihai) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@75928 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r--channels/chan_iax2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 407630d92..57d084f5d 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -6714,7 +6714,9 @@ static int socket_process(struct iax2_thread *thread)
if (option_debug)
ast_log(LOG_DEBUG, "Packet arrived out of order (expecting %d, got %d) (frametype = %d, subclass = %d)\n",
iaxs[fr->callno]->iseqno, fr->oseqno, f.frametype, f.subclass);
- if (iaxs[fr->callno]->iseqno > fr->oseqno) {
+ /* Check to see if we need to request retransmission,
+ * and take sequence number wraparound into account */
+ if ((unsigned char) (iaxs[fr->callno]->iseqno - fr->oseqno) < 128) {
/* If we've already seen it, ack it XXX There's a border condition here XXX */
if ((f.frametype != AST_FRAME_IAX) ||
((f.subclass != IAX_COMMAND_ACK) && (f.subclass != IAX_COMMAND_INVAL))) {