hnbgw: Handle closed connections correctly
We still need to clean up the HNB data structures after the connection is closed
This commit is contained in:
parent
7c27f7b792
commit
4267a29ee0
13
src/hnbgw.c
13
src/hnbgw.c
|
@ -136,9 +136,20 @@ static int hnb_read_cb(struct osmo_fd *fd)
|
|||
if (rc < 0) {
|
||||
LOGP(DMAIN, LOGL_ERROR, "Error during sctp_recvmsg()\n");
|
||||
/* FIXME: clean up after disappeared HNB */
|
||||
close(fd->fd);
|
||||
osmo_fd_unregister(fd);
|
||||
return rc;
|
||||
} else
|
||||
} else if (rc == 0) {
|
||||
LOGP(DMAIN, LOGL_ERROR, "Connection to HNB closed\n");
|
||||
/* TODO: Remove all UEs from that connection */
|
||||
close(fd->fd);
|
||||
osmo_fd_unregister(fd);
|
||||
fd->fd = -1;
|
||||
|
||||
return -1;
|
||||
} else {
|
||||
msgb_put(msg, rc);
|
||||
}
|
||||
|
||||
if (flags & MSG_NOTIFICATION) {
|
||||
LOGP(DMAIN, LOGL_DEBUG, "Ignoring SCTP notification\n");
|
||||
|
|
Loading…
Reference in New Issue