From 7e7ee5f8c6904a607e7505021c16de4c26dadbe0 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 16 Dec 2012 13:07:45 +0100 Subject: [PATCH] mgcp: Fix the vary large jump detection in the code GCC 3.x on PowerPC correctly highlights that the code is fishy. Re-reading the RFC 3550 shows that we should subtract it and then we are in the 16bit range. The probation and re-sync code is still missing. GCC: mgcp/mgcp_network.c:200: warning: comparison is always true due to limited range of data type --- openbsc/src/libmgcp/mgcp_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c index eb8b736b0..a2cfc2385 100644 --- a/openbsc/src/libmgcp/mgcp_network.c +++ b/openbsc/src/libmgcp/mgcp_network.c @@ -196,7 +196,7 @@ static void patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *s if (udelta < RTP_MAX_DROPOUT) { if (seq < state->max_seq) state->cycles += RTP_SEQ_MOD; - } else if (udelta <= RTP_SEQ_MOD + RTP_MAX_MISORDER) { + } else if (udelta <= RTP_SEQ_MOD - RTP_MAX_MISORDER) { LOGP(DMGCP, LOGL_NOTICE, "RTP seqno made a very large jump on 0x%x delta: %u\n", ENDPOINT_NUMBER(endp), udelta);