Message ID | CA+W2XBuGwG3Tg1E4Y9cdGXe2kftyzRJUwrVBiBS0yVEP5PgCOQ@mail.gmail.com |
---|---|
State | Superseded |
Headers | show |
On Fri, May 23, 2014 at 11:44:40AM +0200, Michal Grznár wrote: Hi, > And the problem was as I said in Imsi attach procedure new TLLI == new > allocated P-tmsi, and there was a problem that the function gprs_tmsi2tlli() > function there was not called and so I had to mask the upper bits in > function where the p-tmsi is allocated, there is also a pcap trace where > you can see it. Could you please elaborate of what/were (e.g. packet numbers) we can see "it" and what it should be instead? And please use "git diff" or preferable "git commit" and git format-patch. The "diff" you include is hand-written and sadly not usable because of this. And as written by Harald before. The place you patch is not correct. The method you patch should generate a unique P-TMSI. It might should mask some of the higher bits. But you need to look at the callers of this function if the tlli is not updated. e.g. in src/gprs/gprs_gmm.c you will see something like this: ctx->p_tmsi = sgsn_alloc_ptmsi(); #endif /* Even if there is no P-TMSI allocated, the MS will switch from * foreign TLLI to local TLLI */ ctx->tlli_new = gprs_tmsi2tlli(ctx->p_tmsi, TLLI_LOCAL); /* Inform LLC layer about new TLLI but keep old active */ gprs_llgmm_assign(ctx->llme, ctx->tlli, ctx->tlli_new, GPRS_ALGO_GEA0, NULL); So this call to gprs_tmsi2tlli will make sure that 0xc0000000 will be set. In fact I see two calls to sgsn_alloc_ptmsi and both of them do the above and assign the new tlli to the context. So please could you try to explain what you are trying to solve? holger
On Fri, May 23, 2014 at 11:44:40AM +0200, Michal Grznár wrote: Hi, > Hi, I am sorry for my previous bad post format. There are the right diff > files. > And the problem was as I said in Imsi attach procedure new TLLI == new > allocated P-tmsi, and there was a problem that the function gprs_tmsi2tlli() > function there was not called and so I had to mask the upper bits in > function where the p-tmsi is allocated, there is also a pcap trace where > you can see it. sorry for the late reply. The issue is that your MS does not convert the P-TMSI to a Local-TLLI. On the other hand Jacob has pointed me to some documentation of a measurement equipment manufacturer that states that the local bits/highest two bits of the ptmsi should be set. > > > restart: > > > +++ ptmsi = rand() | 0xc0000000; /*because of GPRS IMSI we will carry a patch like this.
--- gprs_ns_before_patch.c 2014-05-23 10:36:09.041829000 +0200 +++ gprs_ns_patch.c 2014-05-23 10:34:17.101829001 +0200 @@ -1217,16 +1217,14 @@ switch (nsh->pdu_type) { case NS_PDUT_ALIVE: - /* If we're dead and blocked and suddenly receive a - * NS-ALIVE out of the blue, we might have been re-started - * and should send a NS-RESET to make sure everything recovers - * fine. */ - -LOGP(DNS, LOGL_INFO, "Rx NS ALIVE\n"); -if ((*nsvc)->state == NSE_S_BLOCKED) - rc = gprs_ns_tx_reset((*nsvc), NS_CAUSE_PDU_INCOMP_PSTATE); - else - rc = gprs_ns_tx_alive_ack(*nsvc); + LOGP(DNS, LOGL_INFO, "Rx NS ALIVE\n"); + rc = gprs_ns_tx_alive_ack(*nsvc); + /*mark NS-VC as unblocked and active*/ + (*nsvc)->state = NSE_S_ALIVE; + (*nsvc)->remote_state = NSE_S_ALIVE; + /*Initiate TEST proc.: Send ALIVE_ACK and start timer*/ + rc = gprs_ns_tx_simple((*nsvc), NS_PDUT_ALIVE_ACK); + nsvc_start_timer((*nsvc), NSVC_TIMER_TNS_TEST); break; case NS_PDUT_ALIVE_ACK: /* stop Tns-alive and start Tns-test */