pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-mgw/+/29864 )
Change subject: mgw: rx_rtp(): reorder checks and handlings
......................................................................
mgw: rx_rtp(): reorder checks and handlings
Let's first validate the origin of the message, then the content of the
message and finally execute whatever triggers are necessary.
Change-Id: I011a6d7d705768c32a35cec5cd7169725a21a670
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 4 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/64/29864/1
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index f9c7a01..2a4a4eb 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -1510,7 +1510,9 @@
LOG_CONN_RTP(conn_src, LOGL_DEBUG, "rx_rtp(%u bytes)\n", msgb_length(msg));
- mgcp_conn_watchdog_kick(conn_src->conn);
+ /* Check if the origin of the RTP packet seems plausible */
+ if (!trunk->rtp_accept_all && check_rtp_origin(conn_src, from_addr))
+ return -1;
/* If AMR is configured for the ingress connection and conversion of the
* framing mode (octet-aligned vs. bandwith-efficient is explicitly
@@ -1530,9 +1532,7 @@
}
}
- /* Check if the origin of the RTP packet seems plausible */
- if (!trunk->rtp_accept_all && check_rtp_origin(conn_src, from_addr))
- return -1;
+ mgcp_conn_watchdog_kick(conn_src->conn);
/* Execute endpoint specific implementation that handles the
* dispatching of the RTP data */
--
To view, visit
https://gerrit.osmocom.org/c/osmo-mgw/+/29864
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I011a6d7d705768c32a35cec5cd7169725a21a670
Gerrit-Change-Number: 29864
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange