From 25ad52cf6ad66d83696db74fd665e3a7a41b131b Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Thu, 11 Sep 2014 14:20:53 +0200 Subject: sgsn: Reset local LLC parameters when sending XID reset Currently when gprs_llgmm_reset() is invoked an XID reset is sent but the local LLC parameters (e.g. V(U)) are not cleared (see GSM 04.64, 8.5.3.1). This can lead to discarded messages on the SGSN side. This patch modifies gprs_llgmm_reset to clear vu_send, vu_recv, oc_ui_send, oc_ui_recv. Sponsored-by: On-Waves ehf --- openbsc/src/gprs/gprs_llc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c index e6b1f07da..08a95b336 100644 --- a/openbsc/src/gprs/gprs_llc.c +++ b/openbsc/src/gprs/gprs_llc.c @@ -738,14 +738,21 @@ int gprs_llgmm_reset(struct gprs_llc_llme *llme) { struct msgb *msg = msgb_alloc_headroom(4096, 1024, "LLC_XID"); int random = rand(); + struct gprs_llc_lle *lle = &llme->lle[1]; /* First XID component must be RESET */ msgb_put_xid_par(msg, GPRS_LLC_XID_T_RESET, 0, NULL); /* randomly select new IOV-UI */ msgb_put_xid_par(msg, GPRS_LLC_XID_T_IOV_UI, 4, (uint8_t *) &random); + /* Reset some of the LLC parameters. See GSM 04.64, 8.5.3.1 */ + lle->vu_recv = 0; + lle->vu_send = 0; + lle->oc_ui_send = 0; + lle->oc_ui_recv = 0; + /* FIXME: Start T200, wait for XID response */ - return gprs_llc_tx_xid(&llme->lle[1], msg, 1); + return gprs_llc_tx_xid(lle, msg, 1); } int gprs_llc_init(const char *cipher_plugin_path) -- cgit v1.2.3