[PATCH] fix failed .deb build due to failing bssgp test

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/baseband-devel@lists.osmocom.org/.

Max max.suraev at fairwaves.co
Mon Jul 6 16:16:46 UTC 2015


Signed-off-by: Max <max.suraev at fairwaves.co>
---
 tests/Makefile.am          |  1 +
 tests/gb/gprs_bssgp_test.c | 20 +-------------------
 2 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6f76e5a..a739ab9 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -69,6 +69,7 @@ gb_bssgp_fc_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/
 
 gb_gprs_bssgp_test_SOURCES = gb/gprs_bssgp_test.c
 gb_gprs_bssgp_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DL)
+gb_gprs_bssgp_test_LDFLAGS = -static -Wl,--wrap=gprs_ns_sendmsg
 
 gb_gprs_ns_test_SOURCES = gb/gprs_ns_test.c
 gb_gprs_ns_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DL)
diff --git a/tests/gb/gprs_bssgp_test.c b/tests/gb/gprs_bssgp_test.c
index 14ba4d1..4fb24df 100644
--- a/tests/gb/gprs_bssgp_test.c
+++ b/tests/gb/gprs_bssgp_test.c
@@ -34,24 +34,6 @@
 static struct osmo_prim_hdr last_oph = {0};
 
 /* override */
-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);
-
-	if (!real_sendto)
-		real_sendto = dlsym(RTLD_NEXT, "sendto");
-
-	fprintf(stderr, "MESSAGE to 0x%08x, msg length %d\n%s\n",
-		dest_host, len, osmo_hexdump(buf, len));
-
-	return len;
-}
-
-/* override */
 int gprs_ns_callback(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
 			 struct msgb *msg, uint16_t bvci)
 {
@@ -64,7 +46,7 @@ int gprs_ns_callback(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
 struct msgb *last_ns_tx_msg = NULL;
 
 /* override */
-int gprs_ns_sendmsg(struct gprs_ns_inst *nsi, struct msgb *msg)
+int __wrap_gprs_ns_sendmsg(struct gprs_ns_inst *nsi, struct msgb *msg)
 {
 	msgb_free(last_ns_tx_msg);
 	last_ns_tx_msg = msg;
-- 
2.1.4




More information about the baseband-devel mailing list