hnbgw: Handle closed connections correctly

We still need to clean up the HNB data structures after the connection
is closed
diff --git a/src/hnbgw.c b/src/hnbgw.c
index d8ef32d..4ab56cd 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -136,9 +136,20 @@
 	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");