nat: Close SCCP connections when the USSD Provider is closed.
Send a RLSD down to the BSC in case the USSD Provider is gone. It
is not sending a Clear Command and ut depends if the BS+ will
like this kind of behavior. At least the data on the NAT will
be freed soon afterwards due the RLC message.
diff --git a/openbsc/src/nat/bsc_ussd.c b/openbsc/src/nat/bsc_ussd.c
index 3729d91..f10a871 100644
--- a/openbsc/src/nat/bsc_ussd.c
+++ b/openbsc/src/nat/bsc_ussd.c
@@ -61,8 +61,11 @@
static void bsc_nat_ussd_destroy(struct bsc_nat_ussd_con *con)
{
- if (con->nat->ussd_con == con)
+ if (con->nat->ussd_con == con) {
+ bsc_close_ussd_connections(con->nat);
con->nat->ussd_con = NULL;
+ }
+
close(con->queue.bfd.fd);
bsc_unregister_fd(&con->queue.bfd);
bsc_del_timer(&con->auth_timeout);