[PATCH] 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/.

dexter gerrit-no-reply at lists.osmocom.org
Fri Oct 13 16:35:31 UTC 2017


Review at  https://gerrit.osmocom.org/4260

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. OBS).

Remove the execution of the real_sendto and just return len.

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


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/60/4260/1

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: newchange
Gerrit-Change-Id: Ia8fa0770f9bc75725cc6b0cd445e753f7e029ca5
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list