nat: Check the con->imsi for the tracked IMSI
On DT messages we directly write into the tracked SCCP
connection. This means "imsi" will always be NULL at
this check. Change the code to use con->imsi
Fixes: Coverity CID 1293151
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index 2f6711a..93a9145 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1093,8 +1093,8 @@
filter = bsc_nat_filter_dt(bsc, msg,
con, parsed, &cause);
if (filter < 0) {
- if (imsi)
- bsc_nat_inform_reject(bsc, imsi);
+ if (con->imsi)
+ bsc_nat_inform_reject(bsc, con->imsi);
bsc_stat_reject(filter, bsc, 1);
bsc_send_con_release(bsc, con, &cause);
con = NULL;