aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_bssgp_pcu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gprs_bssgp_pcu.cpp')
-rw-r--r--src/gprs_bssgp_pcu.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 6c5d72c..8837ee8 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -27,7 +27,8 @@
static struct gprs_bssgp_pcu the_pcu = { 0, };
extern void *tall_pcu_ctx;
-extern uint16_t spoof_mcc, spoof_mnc;
+extern uint16_t spoof_mcc;
+extern gsm_mnc_t spoof_mnc;
static void bvc_timeout(void *_priv);
@@ -468,14 +469,13 @@ static void bvc_timeout(void *_priv)
struct gprs_bssgp_pcu *gprs_bssgp_create_and_connect(struct gprs_rlcmac_bts *bts,
uint16_t local_port, uint32_t sgsn_ip,
uint16_t sgsn_port, uint16_t nsei, uint16_t nsvci, uint16_t bvci,
- uint16_t mcc, uint16_t mnc, uint16_t lac, uint16_t rac,
+ uint16_t mcc, gsm_mnc_t mnc, uint16_t lac, uint16_t rac,
uint16_t cell_id)
{
struct sockaddr_in dest;
int rc;
mcc = ((mcc & 0xf00) >> 8) * 100 + ((mcc & 0x0f0) >> 4) * 10 + (mcc & 0x00f);
- mnc = ((mnc & 0xf00) >> 8) * 100 + ((mnc & 0x0f0) >> 4) * 10 + (mnc & 0x00f);
cell_id = ntohs(cell_id);
/* if already created... return the current address */
@@ -520,7 +520,11 @@ struct gprs_bssgp_pcu *gprs_bssgp_create_and_connect(struct gprs_rlcmac_bts *bts
return NULL;
}
the_pcu.bctx->ra_id.mcc = spoof_mcc ? : mcc;
- the_pcu.bctx->ra_id.mnc = spoof_mnc ? : mnc;
+ if (spoof_mnc.network_code)
+ the_pcu.bctx->ra_id.mnc = spoof_mnc;
+ else
+ the_pcu.bctx->ra_id.mnc = mnc;
+
the_pcu.bctx->ra_id.lac = lac;
the_pcu.bctx->ra_id.rac = rac;
the_pcu.bctx->cell_id = cell_id;