diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-06-08 12:20:25 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-06-08 12:29:31 +0200 |
commit | dc467ca879426a0e7e2cd264765c3c8c9a624e0a (patch) | |
tree | 2e6aab138d7ba84c77fe831feb0a8de2b3708e3b /openbsc | |
parent | c6d6168e9ebf702ff470600171e83f2988ac1b7b (diff) |
bsc-nat: forward_sccp_to_msc: Remove unneeded exit3 section
exit3 is the same as exit2 with the addition of calling
bsc_send_con_refuse(). Since exit3 path is only followed once, it's
easier to call bsc_send_con_refuse() on that code path and remove exit3
entirely in order to simplify the function.
Change-Id: I2ba0aeca1ee0fffd75019bfba37907f0b8015066
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index b8cbb119d..928dd4c02 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -1142,7 +1142,9 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg) if (imsi) bsc_nat_inform_reject(bsc, imsi); bsc_stat_reject(filter, bsc, 0); - goto exit3; + /* send a SCCP Connection Refused */ + bsc_send_con_refuse(bsc, parsed, con_type, &cause); + goto exit2; } if (!create_sccp_src_ref(bsc, parsed)) @@ -1285,15 +1287,6 @@ exit2: talloc_free(parsed); msgb_free(msg); return -1; - -exit3: - /* send a SCCP Connection Refused */ - if (imsi) - talloc_free(imsi); - bsc_send_con_refuse(bsc, parsed, con_type, &cause); - talloc_free(parsed); - msgb_free(msg); - return -1; } static int ipaccess_bsc_read_cb(struct osmo_fd *bfd) |