[MERGED] osmo-mgw[master]: network: remove unused return code
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 *)>forward, sizeof(tap->forward)); + if (!tap->enabled) + return; + + rc = sendto(fd, buf, len, 0, (struct sockaddr *)>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: dexterGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
osmo-mgw[master]: network: remove unused return code
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4710 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I16c12c4565bccbc0d75c412b43469bf70b6b7ea5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexterGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[PATCH] osmo-mgw[master]: network: remove unused return code
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4710 to look at the new patch set (#2). 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(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/10/4710/2 diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 7876b33..947b87e 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 *)>forward, sizeof(tap->forward)); + if (!tap->enabled) + return; + + rc = sendto(fd, buf, len, 0, (struct sockaddr *)>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: newpatchset Gerrit-Change-Id: I16c12c4565bccbc0d75c412b43469bf70b6b7ea5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexterGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
osmo-mgw[master]: network: remove unused return code
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4710 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I16c12c4565bccbc0d75c412b43469bf70b6b7ea5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexterGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[PATCH] osmo-mgw[master]: network: remove unused return code
Review at https://gerrit.osmocom.org/4710 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 This fixes CID 178666 Change-Id: I16c12c4565bccbc0d75c412b43469bf70b6b7ea5 --- M src/libosmo-mgcp/mgcp_network.c 1 file changed, 12 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/10/4710/1 diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 7876b33..947b87e 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 *)>forward, sizeof(tap->forward)); + if (!tap->enabled) + return; + + rc = sendto(fd, buf, len, 0, (struct sockaddr *)>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: newchange Gerrit-Change-Id: I16c12c4565bccbc0d75c412b43469bf70b6b7ea5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter