[MERGED] osmo-mgw[master]: mgcp_test: do not send rtp packets

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Oct 13 18:42:03 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: mgcp_test: do not send rtp packets
......................................................................


mgcp_test: do not send rtp packets

The sendto() override in mgcp_test sends rtp packets out. This
might be a problem for some test hosts. e.g. on OBS, sending packets
fails with an error message, which exits sendto() early and hence fails
to send the expected amount of "Dummy Packets". Interestingly enough
calling the real sendto is not necessary to run the test at all.

Remove the execution of the real_sendto and just return len.

Related: OS#2561
Change-Id: Ia8fa0770f9bc75725cc6b0cd445e753f7e029ca5
---
M tests/mgcp/mgcp_test.c
1 file changed, 1 insertion(+), 7 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 5b292a5..e14b7ee 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -509,15 +509,9 @@
 ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
 	       const struct sockaddr *dest_addr, socklen_t addrlen)
 {
-	typedef ssize_t(*sendto_t) (int, const void *, size_t, int,
-				    const struct sockaddr *, socklen_t);
-	static sendto_t real_sendto = NULL;
 	uint32_t dest_host =
 	    htonl(((struct sockaddr_in *)dest_addr)->sin_addr.s_addr);
 	int dest_port = htons(((struct sockaddr_in *)dest_addr)->sin_port);
-
-	if (!real_sendto)
-		real_sendto = dlsym(RTLD_NEXT, "sendto");
 
 	if (len == 1 && ((const char *)buf)[0] == MGCP_DUMMY_LOAD) {
 		fprintf(stderr,
@@ -526,7 +520,7 @@
 		dummy_packets += 1;
 	}
 
-	return real_sendto(sockfd, buf, len, flags, dest_addr, addrlen);
+	return len;
 }
 
 static int64_t force_monotonic_time_us = -1;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8fa0770f9bc75725cc6b0cd445e753f7e029ca5
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list