Project

General

Profile

osmo-sgsn-do-not-send-problematic-gtp-ies.patch

roox, 11/12/2018 11:34 PM

View differences:

src/gprs/sgsn_libgtp.c
257 257
	memcpy(pdp->gsnlu.v, &sgsn->cfg.gtp_listenaddr.sin_addr,
258 258
		sizeof(sgsn->cfg.gtp_listenaddr.sin_addr));
259 259

  
260
	/* Encode RAT Type according to TS 29.060 7.7.50 */
261
	pdp->rattype.l = 1;
262
	if (mmctx->ran_type == MM_CTX_T_UTRAN_Iu)
263
		pdp->rattype.v[0] = 1;
264
	else
265
		pdp->rattype.v[0] = 2;
266
	pdp->rattype_given = 1;
267

  
268
	/* Include RAI and ULI all the time */
269
	pdp->rai_given = 1;
270
	pdp->rai.l = 6;
260
//	/* Encode RAT Type according to TS 29.060 7.7.50 */
261
//	pdp->rattype.l = 1;
262
//	if (mmctx->ran_type == MM_CTX_T_UTRAN_Iu)
263
//		pdp->rattype.v[0] = 1;
264
//	else
265
//		pdp->rattype.v[0] = 2;
266
//	pdp->rattype_given = 1;
267
//
268
//	/* Include RAI and ULI all the time */
269
//	pdp->rai_given = 1;
270
//	pdp->rai.l = 6;
271 271

  
272 272
	/* Routing Area Identifier with LAC and RAC fixed values, as
273 273
	 * requested in 29.006 7.3.1 */
......
276 276
	raid.rac = 0xFF;
277 277
	gsm48_encode_ra((struct gsm48_ra_id *)pdp->rai.v, &raid);
278 278

  
279
	/* Encode User Location Information accordint to TS 29.060 7.7.51 */
280
	pdp->userloc_given = 1;
281
	pdp->userloc.l = 8;
282
	switch (mmctx->ran_type) {
283
	case MM_CTX_T_GERAN_Gb:
284
	case MM_CTX_T_GERAN_Iu:
285
		pdp->rattype.v[0] = 2;
286
		/* User Location Information */
287
		pdp->userloc_given = 1;
288
		pdp->userloc.l = 8;
289
		pdp->userloc.v[0] = 0; /* CGI for GERAN */
290
		bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id);
291
		break;
292
	case MM_CTX_T_UTRAN_Iu:
293
		pdp->userloc.v[0] = 1; /* SAI for UTRAN */
294
		/* SAI is like CGI but with SAC instead of CID, so we can abuse this function */
295
		bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->iu.sac);
296
		break;
297
	}
298

  
299
	/* include the IMEI(SV) */
300
	pdp->imeisv_given = 1;
301
	gsm48_encode_bcd_number(&pdp->imeisv.v[0], 8, 0, mmctx->imei);
302
	pdp->imeisv.l = pdp->imeisv.v[0];
303
	memmove(&pdp->imeisv.v[0], &pdp->imeisv.v[1], 8);
279
//	/* Encode User Location Information accordint to TS 29.060 7.7.51 */
280
//	pdp->userloc_given = 1;
281
//	pdp->userloc.l = 8;
282
//	switch (mmctx->ran_type) {
283
//	case MM_CTX_T_GERAN_Gb:
284
//	case MM_CTX_T_GERAN_Iu:
285
//		pdp->rattype.v[0] = 2;
286
//		/* User Location Information */
287
//		pdp->userloc_given = 1;
288
//		pdp->userloc.l = 8;
289
//		pdp->userloc.v[0] = 0; /* CGI for GERAN */
290
//		bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id);
291
//		break;
292
//	case MM_CTX_T_UTRAN_Iu:
293
//		pdp->userloc.v[0] = 1; /* SAI for UTRAN */
294
//		/* SAI is like CGI but with SAC instead of CID, so we can abuse this function */
295
//		bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->iu.sac);
296
//		break;
297
//	}
298

  
299
//	/* include the IMEI(SV) */
300
//	pdp->imeisv_given = 1;
301
//	gsm48_encode_bcd_number(&pdp->imeisv.v[0], 8, 0, mmctx->imei);
302
//	pdp->imeisv.l = pdp->imeisv.v[0];
303
//	memmove(&pdp->imeisv.v[0], &pdp->imeisv.v[1], 8);
304 304

  
305 305
	/* change pdp state to 'requested' */
306 306
	pctx->state = PDP_STATE_CR_REQ;
Add picture from clipboard (Maximum size: 48.8 MB)