Change in openbsc[master]: bsc-nat: forward_sccp_to_msc: Remove unneeded exit3 section

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Fri Jun 8 11:39:30 UTC 2018


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9508


Change subject: bsc-nat: forward_sccp_to_msc: Remove unneeded exit3 section
......................................................................

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
---
M openbsc/src/osmo-bsc_nat/bsc_nat.c
1 file changed, 3 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/08/9508/1

diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index b8cbb11..928dd4c 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1142,7 +1142,9 @@
 				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 @@
 	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)

-- 
To view, visit https://gerrit.osmocom.org/9508
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ba0aeca1ee0fffd75019bfba37907f0b8015066
Gerrit-Change-Number: 9508
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180608/2921124c/attachment.htm>


More information about the gerrit-log mailing list