From ded02cfc290e30f8d635ab73b9febab0ce89768c Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 19 Dec 2022 13:24:02 +0100 Subject: [PATCH] iuup: Use osmo_amr_ft_valid() API This is the only user outside libosmo-abis using this define, which meaning is not clear at all. Let's simply use the related API to clearly check the FT. Related: SYS#6161 Change-Id: I40c7ed2e7f6a99a33b467734e33acf3d5befac0d --- src/libosmo-mgcp/mgcp_iuup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libosmo-mgcp/mgcp_iuup.c b/src/libosmo-mgcp/mgcp_iuup.c index 9779692e7..6ad62c8d8 100644 --- a/src/libosmo-mgcp/mgcp_iuup.c +++ b/src/libosmo-mgcp/mgcp_iuup.c @@ -672,7 +672,7 @@ int mgcp_conn_iuup_send_rtp(struct mgcp_conn_rtp *conn_src_rtp, struct mgcp_conn "Bridge RTP=>IuUP: too short for AMR OA hdr (%u)\n", msgb_length(msg)); goto free_ret; } - if (amr_hdr->ft >= AMR_FT_MAX) { + if (!osmo_amr_ft_valid(amr_hdr->ft)) { LOG_CONN_RTP(conn_src_rtp, LOGL_NOTICE, "Bridge RTP=>IuUP: wrong AMR OA ft=%u\n", amr_hdr->ft); goto free_ret; } @@ -695,7 +695,7 @@ int mgcp_conn_iuup_send_rtp(struct mgcp_conn_rtp *conn_src_rtp, struct mgcp_conn goto free_ret; } ft = ((amr_bwe_hdr[0] & 0x07) << 1) | ((amr_bwe_hdr[1] & 0x80) >> 7); - if (ft >= AMR_FT_MAX) { + if (!osmo_amr_ft_valid(ft)) { LOG_CONN_RTP(conn_src_rtp, LOGL_NOTICE, "Bridge RTP=>IuUP: wrong AMR BE ft=%u\n", ft); goto free_ret; }