summaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gb_proxy_patch.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-09-05 10:22:27 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2014-09-09 09:47:03 +0200
commit37fda77814586d55f9d9517871d874408c914d15 (patch)
treed64cd4f121bddb9a16cccbad30d97690fb79c4cf /openbsc/src/gprs/gb_proxy_patch.c
parent52f070a099f639edd4d8aa23f0c8155a80e4300c (diff)
gbproxy: Change creation of tlli_info for SGSN originated messages
Currently tlli_info are created for SGSN originated messages when the SGSN TLLI cannot be found and P-TMSI patching is active. This doesn't make much sense, since the BSS side TLLI is not known in this case. Given that the SGSN is working properly, that can only happen if either the tlli_info has expired or the gbproxy has been restarted. This patch disables the creation of a tlli_info in this case. Note that these messages are passed unmodified to the MS so far. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gb_proxy_patch.c')
-rw-r--r--openbsc/src/gprs/gb_proxy_patch.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/openbsc/src/gprs/gb_proxy_patch.c b/openbsc/src/gprs/gb_proxy_patch.c
index c1b88d9..970f2f6 100644
--- a/openbsc/src/gprs/gb_proxy_patch.c
+++ b/openbsc/src/gprs/gb_proxy_patch.c
@@ -335,6 +335,15 @@ void gbproxy_patch_bssgp(struct msgb *msg, uint8_t *bssgp, size_t bssgp_len,
goto patch_error;
}
+ if (!tlli_info && parse_ctx->tlli_enc && parse_ctx->to_bss) {
+ /* Happens with unknown (not cached) TLLI coming from
+ * the SGSN */
+ /* TODO: What shall be done with the message in this case? */
+ err_ctr = GBPROX_PEER_CTR_TLLI_UNKNOWN;
+ err_info = "TLLI sent by the SGSN is unknown";
+ goto patch_error;
+ }
+
if (!tlli_info)
return;
@@ -346,13 +355,6 @@ void gbproxy_patch_bssgp(struct msgb *msg, uint8_t *bssgp, size_t bssgp_len,
gbproxy_patch_tlli(parse_ctx->tlli_enc, peer, tlli,
parse_ctx->to_bss, "TLLI");
parse_ctx->tlli = tlli;
- } else if (parse_ctx->to_bss) {
- /* Happens with unknown (not cached) TLLI coming from
- * the SGSN */
- /* TODO: What shall be done with the message in this case? */
- err_ctr = GBPROX_PEER_CTR_TLLI_UNKNOWN;
- err_info = "TLLI sent by the SGSN is unknown";
- goto patch_error;
} else {
/* Internal error */
err_ctr = GBPROX_PEER_CTR_PATCH_ERR;