aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc_nat/bsc_ussd.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-02-13 17:37:39 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-02-14 12:15:40 +0100
commit978f58cd2e41212d5e1f1543e9f05137831304e1 (patch)
tree5519a7dc74d5b6edad2039d41b5dba6b9b7476d7 /src/osmo-bsc_nat/bsc_ussd.c
parent7997bf4bed15fa8c6807820b1a9b379a2ae0c61e (diff)
libcommon: eliminate socket.c
Replace calls to make_sock() with osmo_sock_init_ofd(). Shame on me for not testing every single one in practice, I hope for peer review to confirm that this should be correct... Read closely please! The IPPROTO_GRE define seems to be unused (at least in osmo-bsc.git), drop it completely. Change-Id: Ia6e4e0e1eed3328fa25b3b90be376d532ad0e56b
Diffstat (limited to 'src/osmo-bsc_nat/bsc_ussd.c')
-rw-r--r--src/osmo-bsc_nat/bsc_ussd.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/osmo-bsc_nat/bsc_ussd.c b/src/osmo-bsc_nat/bsc_ussd.c
index 20df8d1ed..985a558dc 100644
--- a/src/osmo-bsc_nat/bsc_ussd.c
+++ b/src/osmo-bsc_nat/bsc_ussd.c
@@ -20,11 +20,12 @@
*
*/
+#include <osmocom/core/socket.h>
+
#include <osmocom/bsc/bsc_nat.h>
#include <osmocom/bsc/bsc_nat_sccp.h>
#include <osmocom/bsc/bsc_msg_filter.h>
#include <osmocom/bsc/ipaccess.h>
-#include <osmocom/bsc/socket.h>
#include <osmocom/bsc/debug.h>
#include <osmocom/gsm/protocol/gsm_08_08.h>
@@ -282,15 +283,10 @@ static int ussd_listen_cb(struct osmo_fd *bfd, unsigned int what)
int bsc_ussd_init(struct bsc_nat *nat)
{
- struct in_addr addr;
-
- addr.s_addr = INADDR_ANY;
- if (nat->ussd_local)
- inet_aton(nat->ussd_local, &addr);
-
+ nat->ussd_listen.cb = ussd_listen_cb;
nat->ussd_listen.data = nat;
- return make_sock(&nat->ussd_listen, IPPROTO_TCP,
- ntohl(addr.s_addr), 5001, 0, ussd_listen_cb, nat);
+ return osmo_sock_init_ofd(&nat->ussd_listen, AF_INET, SOCK_STREAM, IPPROTO_TCP,
+ nat->ussd_local, 5001, OSMO_SOCK_F_BIND);
}
static int forward_ussd_simple(struct nat_sccp_connection *con, struct msgb *input)