[PATCH 3/4] Catch up with API change in osmo_sock_init

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

Daniel Willmann daniel at totalueberwachung.de
Sun Jul 17 15:48:19 UTC 2011


The connect0_bind1 parameter has been replaced by a generic flag
parameter. With this patch osmo-pcap works (only) with versions of
libosmocore 0.3.2 or newer - configure.ac changed to reflects that.
---
 configure.ac              |    2 +-
 src/osmo_client_network.c |    2 +-
 src/osmo_server_network.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 51669ec..9977ef6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,7 +15,7 @@ AC_PROG_INSTALL
 AC_PROG_RANLIB
 
 dnl checks for libraries
-PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.0)
+PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2)
 PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
 
 dnl checks for header files
diff --git a/src/osmo_client_network.c b/src/osmo_client_network.c
index 281e8eb..bd1b9db 100644
--- a/src/osmo_client_network.c
+++ b/src/osmo_client_network.c
@@ -163,7 +163,7 @@ void osmo_client_connect(struct osmo_pcap_client *client)
 	osmo_wqueue_clear(&client->wqueue);
 
 	fd = osmo_sock_init(AF_INET, SOCK_STREAM, IPPROTO_TCP,
-			    client->srv_ip, client->srv_port, 0);
+			    client->srv_ip, client->srv_port, OSMO_SOCK_F_CONNECT);
 	if (fd < 0) {
 		LOGP(DCLIENT, LOGL_ERROR,
 		     "Failed to connect to %s:%d\n",
diff --git a/src/osmo_server_network.c b/src/osmo_server_network.c
index 513ca1f..a67f07a 100644
--- a/src/osmo_server_network.c
+++ b/src/osmo_server_network.c
@@ -322,7 +322,7 @@ int osmo_pcap_server_listen(struct osmo_pcap_server *server)
 	int fd;
 
 	fd = osmo_sock_init(AF_INET, SOCK_STREAM, IPPROTO_TCP,
-			    server->addr, server->port, 1);
+			    server->addr, server->port, OSMO_SOCK_F_BIND);
 	if (fd < 0) {
 		LOGP(DSERVER, LOGL_ERROR, "Failed to create the server socket.\n");
 		return -1;
-- 
1.7.5.3





More information about the OpenBSC mailing list