hsl: close socket if we destroy the signalling link
As we do in ipaccess driver, the socket is not useful anymore
if the BSC/BTS decides to close the signalling link.
diff --git a/src/input/hsl.c b/src/input/hsl.c
index 7058f48..9861063 100644
--- a/src/input/hsl.c
+++ b/src/input/hsl.c
@@ -307,6 +307,19 @@
return rc;
}
+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_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;
+ }
+}
+
static int hsl_line_update(struct e1inp_line *line,
enum e1inp_line_role role, const char *addr);
@@ -314,6 +327,7 @@
.name = "hsl",
.want_write = ts_want_write,
.line_update = hsl_line_update,
+ .close = hsl_close,
.default_delay = 0,
};