ipaccess: fix write path for OML socket
We have to use e1i_ts->driver.ipaccess.fd file descriptor to
fix the write path. Otherwise, openBSC never delivers replies
to OML messages.
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index d1ada94..5d084d8 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -336,10 +336,6 @@
struct e1inp_ts *e1i_ts;
struct osmo_fd *bfd;
- bfd = talloc_zero(tall_ipa_ctx, struct osmo_fd);
- if (!bfd)
- return -ENOMEM;
-
/* create virrtual E1 timeslots for signalling */
e1inp_ts_config_sign(&line->ts[1-1], line);
@@ -349,6 +345,7 @@
e1i_ts = &line->ts[idx];
+ bfd = &e1i_ts->driver.ipaccess.fd;
bfd->fd = fd;
bfd->data = line;
bfd->priv_nr = E1INP_SIGN_OML;
@@ -358,7 +355,6 @@
if (ret < 0) {
LOGP(DINP, LOGL_ERROR, "could not register FD\n");
close(bfd->fd);
- talloc_free(bfd);
return ret;
}