summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso2011-07-08 20:36:05 +0200
committerPablo Neira Ayuso2011-07-08 20:36:05 +0200
commit34073fbc97de2db185f746b25fa79b2013d9aa6a (patch)
tree6618f216483ab8611adae790eb05c933caf8a415
parenttests: add missing hsl examples (diff)
downloadlibosmo-abis-34073fbc97de2db185f746b25fa79b2013d9aa6a.tar.gz
libosmo-abis-34073fbc97de2db185f746b25fa79b2013d9aa6a.tar.xz
libosmo-abis-34073fbc97de2db185f746b25fa79b2013d9aa6a.zip
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.
-rw-r--r--src/input/hsl.c14
1 files changed, 14 insertions, 0 deletions
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 @@ static int hsl_fd_cb(struct osmo_fd *bfd, unsigned int what)
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 @@ struct e1inp_driver hsl_driver = {
.name = "hsl",
.want_write = ts_want_write,
.line_update = hsl_line_update,
+ .close = hsl_close,
.default_delay = 0,
};