osmux: assert no batch factor greater than 8 is used

Change-Id: Ie17a8174bc220d091cb7ff880363d22179b4f621
This commit is contained in:
Pau Espin 2022-09-27 18:26:48 +02:00
parent a50895f7eb
commit 8a3b1acf35
1 changed files with 2 additions and 1 deletions

View File

@ -318,7 +318,8 @@ static int osmux_batch_enqueue(struct msgb *msg, struct osmux_circuit *circuit,
/* Validate amount of messages per batch. The counter field of the
* osmux header is just 3 bits long, so make sure it doesn't overflow.
*/
if (circuit->nmsgs >= batch_factor || circuit->nmsgs >= 8) {
OSMO_ASSERT(batch_factor <= 8);
if (circuit->nmsgs >= batch_factor) {
struct rtp_hdr *rtph;
rtph = osmo_rtp_get_hdr(msg);