aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-10-19 13:13:36 +0200
committerlaforge <laforge@osmocom.org>2020-11-11 20:14:27 +0000
commit4dc5dcf4e0d238638c03cb1bc8f8401510099853 (patch)
treef24eee94a9dd94b1a34008029705eecdaf697c21
parente188010474a7770c2b8ab37d3c4e54170159a632 (diff)
Use osmo_fd_*_{disable,enable}
-rw-r--r--TODO-RELEASE1
-rw-r--r--src/libmsc/mncc_sock.c12
2 files changed, 7 insertions, 6 deletions
diff --git a/TODO-RELEASE b/TODO-RELEASE
index fdddbc2f2..9c358aedd 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -10,3 +10,4 @@
manual needs common chapter cs7-config.adoc, vty_cpu_sched.adoc from osmo-gsm-manuals > 0.3.0
osmo-msc Mobile Identity Coding OsmoMSC is stricter in rejecting invalid coding of Mobile Identity IEs
libmosmo-mgcp-client needs osmo-mgw.git > 1.7.0 (8667d5169df8d06e10ee3f3104e4cd533d15ac57), ABI break due to struct size in mgcp_conn_peer and mgcp_response
+osmo-msc update version dependency to version with osmo_fd_*_{disable,enable}
diff --git a/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c
index 4c1362d43..b76855fad 100644
--- a/src/libmsc/mncc_sock.c
+++ b/src/libmsc/mncc_sock.c
@@ -65,7 +65,7 @@ int mncc_sock_from_cc(struct gsm_network *net, struct msgb *msg)
/* Actually enqueue the message and mark socket write need */
msgb_enqueue(&net->upqueue, msg);
- net->mncc_state->conn_bfd.when |= OSMO_FD_WRITE;
+ osmo_fd_write_enable(&net->mncc_state->conn_bfd);
return 0;
}
@@ -80,7 +80,7 @@ static void mncc_sock_close(struct mncc_sock_state *state)
osmo_fd_unregister(bfd);
/* re-enable the generation of ACCEPT for new connections */
- state->listen_bfd.when |= OSMO_FD_READ;
+ osmo_fd_read_enable(&state->listen_bfd);
/* release all existing calls */
gsm0408_clear_all_trans(state->net, TRANS_CC);
@@ -146,7 +146,7 @@ static int mncc_sock_write(struct osmo_fd *bfd)
msg = llist_entry(net->upqueue.next, struct msgb, list);
mncc_prim = (struct gsm_mncc *)msg->data;
- bfd->when &= ~OSMO_FD_WRITE;
+ osmo_fd_write_disable(bfd);
/* bug hunter 8-): maybe someone forgot msgb_put(...) ? */
if (!msgb_length(msg)) {
@@ -161,7 +161,7 @@ static int mncc_sock_write(struct osmo_fd *bfd)
goto close;
if (rc < 0) {
if (errno == EAGAIN) {
- bfd->when |= OSMO_FD_WRITE;
+ osmo_fd_write_enable(bfd);
break;
}
goto close;
@@ -222,7 +222,7 @@ static void queue_hello(struct mncc_sock_state *mncc)
hello->lchan_type_offset = offsetof(struct gsm_mncc, lchan_type);
msgb_enqueue(&mncc->net->upqueue, msg);
- mncc->conn_bfd.when |= OSMO_FD_WRITE;
+ osmo_fd_write_enable(&mncc->conn_bfd);
}
/* accept a new connection */
@@ -245,7 +245,7 @@ static int mncc_sock_accept(struct osmo_fd *bfd, unsigned int flags)
LOGP(DMNCC, LOGL_NOTICE, "MNCC app connects but we already have "
"another active connection ?!?\n");
/* We already have one MNCC app connected, this is all we support */
- state->listen_bfd.when &= ~OSMO_FD_READ;
+ osmo_fd_read_disable(&state->listen_bfd);
close(rc);
return 0;
}