Change in osmo-mgw[master]: mgcp_send_dummy: Check RTP destination is available before attempt tx

pespin gerrit-no-reply at lists.osmocom.org
Wed Jul 7 14:12:36 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/24861 )

Change subject: mgcp_send_dummy: Check RTP destination is available before attempt tx
......................................................................

mgcp_send_dummy: Check RTP destination is available before attempt tx

Several log messages showing "Failed to send dummy RTP packet." were
seen in a osmo-mgw on the field. Let's re-use the function to check and
provide more information on what's wrong to ease debugging.

Related: SYS#5498
Change-Id: Iee6ac1f4d24c131e3bf40c37e6fdc252e5208ec8
---
M src/libosmo-mgcp/mgcp_network.c
M tests/mgcp/mgcp_test.c
M tests/mgcp/mgcp_test.ok
3 files changed, 10 insertions(+), 7 deletions(-)

Approvals:
  neels: Looks good to me, but someone else must approve
  dexter: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index dfa952b..5b3ea51 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -1037,6 +1037,12 @@
 	LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, "sending dummy packet... %s\n",
 		 mgcp_conn_dump(conn->conn));
 
+	/* Before we try to deliver the packet, we check if the destination
+	 * port and IP-Address make sense at all. If not, we will be unable
+	 * to deliver the packet. */
+	if (check_rtp_destin(conn) != 0)
+		goto failed;
+
 	rc = mgcp_udp_send(conn->end.rtp.fd, &conn->end.addr,
 			   conn->end.rtp_port, rtp_dummy_payload, sizeof(rtp_dummy_payload));
 
diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index e6862e5..5bb7b27 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -634,6 +634,10 @@
 		dummy_packets += 1;
 	}
 
+	/* Make sure address+port are valid */
+	OSMO_ASSERT(dest_host);
+	OSMO_ASSERT(dest_port);
+
 	return len;
 }
 
diff --git a/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok
index 9c48147..d3f8a26 100644
--- a/tests/mgcp/mgcp_test.ok
+++ b/tests/mgcp/mgcp_test.ok
@@ -118,7 +118,6 @@
 using message with patched conn_id for comparison
 Response matches our expectations.
 (response contains a connection id)
-Dummy packets: 2
 
 ================================================
 Testing MDCX4_PT1
@@ -142,7 +141,6 @@
 using message with patched conn_id for comparison
 Response matches our expectations.
 (response contains a connection id)
-Dummy packets: 2
 
 ================================================
 Testing MDCX4_PT2
@@ -166,7 +164,6 @@
 using message with patched conn_id for comparison
 Response matches our expectations.
 (response contains a connection id)
-Dummy packets: 2
 
 ================================================
 Testing MDCX4_PT3
@@ -190,7 +187,6 @@
 using message with patched conn_id for comparison
 Response matches our expectations.
 (response contains a connection id)
-Dummy packets: 2
 
 ================================================
 Testing MDCX4_PT4
@@ -214,7 +210,6 @@
 using message with patched conn_id for comparison
 Response matches our expectations.
 (response contains a connection id)
-Dummy packets: 2
 
 ================================================
 Testing MDCX4_SO
@@ -253,7 +248,6 @@
 using message with patched conn_id for comparison
 Response matches our expectations.
 (response contains a connection id)
-Dummy packets: 2
 
 ================================================
 Testing DLCX
@@ -441,7 +435,6 @@
 using message with patched conn_id for comparison
 Response matches our expectations.
 (response contains a connection id)
-Dummy packets: 2
 
 ================================================
 Testing CRCX

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/24861
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Iee6ac1f4d24c131e3bf40c37e6fdc252e5208ec8
Gerrit-Change-Number: 24861
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210707/54612115/attachment.htm>


More information about the gerrit-log mailing list