laforge has submitted this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/34120 )
Change subject: sgsn_rim: get rid of MME check in sgsn_rim_rx_from_gtp:
......................................................................
sgsn_rim: get rid of MME check in sgsn_rim_rx_from_gtp:
There is no point in checking the MME any further. When the message has
reached this code path it is about to be forwarded to BSSGP, so the MME
does not play a role in the following code pathes.
The check also relys on the source RIM ROUTING INFORMATION IE inside the
RAN TRANSPARENT CONTAINER, which we are not supposed to decode.
Change-Id: I97c89aeb11537ae54d1fbea48c75619d8a92af61
Related: OS#6095
---
M include/osmocom/sgsn/sgsn_rim.h
M src/sgsn/sgsn_libgtp.c
M src/sgsn/sgsn_rim.c
3 files changed, 28 insertions(+), 22 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/include/osmocom/sgsn/sgsn_rim.h b/include/osmocom/sgsn/sgsn_rim.h
index aa5a726..f43b09a 100644
--- a/include/osmocom/sgsn/sgsn_rim.h
+++ b/include/osmocom/sgsn/sgsn_rim.h
@@ -3,4 +3,4 @@
struct sgsn_mme_ctx;
int sgsn_rim_rx_from_gb(struct osmo_bssgp_prim *bp, struct msgb *msg);
-int sgsn_rim_rx_from_gtp(struct bssgp_ran_information_pdu *pdu, struct sgsn_mme_ctx
*mme);
+int sgsn_rim_rx_from_gtp(struct bssgp_ran_information_pdu *pdu);
diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c
index 7c08e6f..156f730 100644
--- a/src/sgsn/sgsn_libgtp.c
+++ b/src/sgsn/sgsn_libgtp.c
@@ -712,7 +712,7 @@
}
msgb_free(msg);
- return sgsn_rim_rx_from_gtp(&pdu, mme);
+ return sgsn_rim_rx_from_gtp(&pdu);
ret_error:
msgb_free(msg);
diff --git a/src/sgsn/sgsn_rim.c b/src/sgsn/sgsn_rim.c
index 4ba672e..c4a4a78 100644
--- a/src/sgsn/sgsn_rim.c
+++ b/src/sgsn/sgsn_rim.c
@@ -91,35 +91,24 @@
}
/* Receive a RIM PDU from GTPv1C (EUTRAN) */
-int sgsn_rim_rx_from_gtp(struct bssgp_ran_information_pdu *pdu, struct sgsn_mme_ctx
*mme)
+int sgsn_rim_rx_from_gtp(struct bssgp_ran_information_pdu *pdu)
{
- struct sgsn_mme_ctx *mme_tmp;
if (pdu->routing_info_src.discr != BSSGP_RIM_ROUTING_INFO_EUTRAN) {
- LOGMME(mme, DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: Expected src %s, got
%s\n",
- bssgp_rim_routing_info_discr_str(BSSGP_RIM_ROUTING_INFO_EUTRAN),
- bssgp_rim_routing_info_discr_str(pdu->routing_info_src.discr));
+ LOGP(DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: Expected src %s, got
%s\n",
+ bssgp_rim_routing_info_discr_str(BSSGP_RIM_ROUTING_INFO_EUTRAN),
+ bssgp_rim_routing_info_discr_str(pdu->routing_info_src.discr));
return -EINVAL;
}
if (pdu->routing_info_dest.discr != BSSGP_RIM_ROUTING_INFO_GERAN) {
- LOGMME(mme, DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: Expected dst %s, got
%s\n",
- bssgp_rim_routing_info_discr_str(BSSGP_RIM_ROUTING_INFO_GERAN),
- bssgp_rim_routing_info_discr_str(pdu->routing_info_dest.discr));
+ LOGP(DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: Expected dst %s, got
%s\n",
+ bssgp_rim_routing_info_discr_str(BSSGP_RIM_ROUTING_INFO_GERAN),
+ bssgp_rim_routing_info_discr_str(pdu->routing_info_dest.discr));
return -EINVAL;
}
- mme_tmp = sgsn_mme_ctx_by_route(sgsn, &pdu->routing_info_src.eutran.tai);
- if (!mme_tmp)/* See if we have a default route configured */
- mme_tmp = sgsn_mme_ctx_by_default_route(sgsn);
- if (mme != mme_tmp) {
- LOGP(DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: "
- "Source MME doesn't have RIM routing configured for TAI: %s\n",
- bssgp_rim_ri_name(&pdu->routing_info_src));
- return -EINVAL;
- }
-
- LOGMME(mme, DRIM, LOGL_INFO, "Rx GTP RAN Information Relay for dest cell
%s\n",
- bssgp_rim_ri_name(&pdu->routing_info_dest));
+ LOGP(DRIM, LOGL_INFO, "Rx GTP RAN Information Relay for dest cell %s\n",
+ bssgp_rim_ri_name(&pdu->routing_info_dest));
return sgsn_bssgp_fwd_rim_to_geran(pdu);
}
--
To view, visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/34120
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I97c89aeb11537ae54d1fbea48c75619d8a92af61
Gerrit-Change-Number: 34120
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged