aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-12-16 13:07:45 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-06-17 09:52:36 +0200
commit431cb1583428b0187ad42ec3707f7f15db359864 (patch)
tree8209a9954907efb49381a8b866696ec167810045
parent7bdad615774cd472104a465aaccf4a9337df8284 (diff)
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
-rw-r--r--openbsc/src/libmgcp/mgcp_network.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c
index 8b95adb4d..4aa135391 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -191,7 +191,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);