abis/close: Deliver S_L_INP_TEI_DN when closing the socket
* HSL/IPA had different socket closing code for the same thing,
create one method for it.
* Both methods tried to send an event but as we are on the close
path the sign_link was already removed from the list and the
input event sending method couldn't find the sign_link using the
sapi/tei provided.
diff --git a/src/input/hsl.c b/src/input/hsl.c
index 408228e..3dcba1d 100644
--- a/src/input/hsl.c
+++ b/src/input/hsl.c
@@ -307,15 +307,9 @@
static void hsl_close(struct e1inp_sign_link *sign_link)
{
- struct e1inp_ts *ts = sign_link->ts;
- struct osmo_fd *bfd = &ts->driver.ipaccess.fd;
- e1inp_event(ts, S_L_INP_TEI_DN, sign_link->tei, sign_link->sapi);
- /* the first e1inp_sign_link_destroy call closes the socket. */
- if (bfd->fd != -1) {
- osmo_fd_unregister(bfd);
- close(bfd->fd);
- bfd->fd = -1;
- }
+ struct e1inp_ts *e1i_ts = sign_link->ts;
+ struct osmo_fd *bfd = &e1i_ts->driver.ipaccess.fd;
+ return e1inp_close_socket(e1i_ts, sign_link, bfd);
}
static int hsl_line_update(struct e1inp_line *line);