From 84fffecba5f172aa66fa363e0e37e0ad43c4f3b6 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 15 Dec 2013 22:20:13 +0100 Subject: osmux: fix handling of too big RTP message in osmux_xfrm_input() With this patch, osmux_xfrm_input() returns 0 (means "message has been processed") instead of 1 (means "retry") if the RTP message is too big to fit into one osmux batch. This fixes a likely infinite loop in the caller, which will retry forever for a message does not fit into the batch. Unlikely to happen in normal scenario, as RTP+AMR messages are way smaller than the interface MTU. --- src/osmux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/osmux.c') diff --git a/src/osmux.c b/src/osmux.c index 15c2739..0acffd7 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -472,7 +472,7 @@ int osmux_xfrm_input(struct osmux_in_handle *h, struct msgb *msg, int ccid) * to avoid a possible forever loop in the caller. */ if (msg->len > OSMUX_BATCH_MAX - sizeof(struct osmux_hdr)) - return 1; + return 0; rtph = osmo_rtp_get_hdr(msg); if (rtph == NULL) -- cgit v1.2.3