[MERGED] osmo-mgw[master]: network: remove unused return code

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Nov 8 19:14:06 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: network: remove unused return code
......................................................................


network: remove unused return code

The function that forwards the tapped (voice ebug) traffic returns
its status (sendto) to the caller. However, none of the callers
seem need this info.

Remove the return code and print an error message on failure

Fixes: Coverity CID#178666
Change-Id: I16c12c4565bccbc0d75c412b43469bf70b6b7ea5
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 12 insertions(+), 6 deletions(-)

Approvals:
  Harald Welte: 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 28d1fed..d51b829 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -627,14 +627,20 @@
 
 /* Forward data to a debug tap. This is debug function that is intended for
  * debugging the voice traffic with tools like gstreamer */
-static int forward_data(int fd, struct mgcp_rtp_tap *tap, const char *buf,
-			int len)
+static void forward_data(int fd, struct mgcp_rtp_tap *tap, const char *buf,
+			 int len)
 {
-	if (!tap->enabled)
-		return 0;
+	int rc;
 
-	return sendto(fd, buf, len, 0,
-		      (struct sockaddr *)&tap->forward, sizeof(tap->forward));
+	if (!tap->enabled)
+		return;
+
+	rc = sendto(fd, buf, len, 0, (struct sockaddr *)&tap->forward,
+		    sizeof(tap->forward));
+
+	if (rc < 0)
+		LOGP(DRTP, LOGL_ERROR,
+		     "Forwarding tapped (debug) voice data failed.\n");
 }
 
 /*! Send RTP/RTCP data to a specified destination connection.

-- 
To view, visit https://gerrit.osmocom.org/4710
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I16c12c4565bccbc0d75c412b43469bf70b6b7ea5
Gerrit-PatchSet: 3
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list