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
diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c
index e6b1f07..08a95b3 100644
--- a/openbsc/src/gprs/gprs_llc.c
+++ b/openbsc/src/gprs/gprs_llc.c
@@ -738,14 +738,21 @@
 {
 	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)