sgsn: Fill the cch_pdp with a value coming from the tlv structure

For some GGSNs we need to insert the PDP Charging Characteristics
that were returned. We receive these values from GSUP and will
fill them into the tlv structure when finding the ggsn context.

Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906
diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c
index 7595bf8..0a0de08 100644
--- a/src/gprs/sgsn_libgtp.c
+++ b/src/gprs/sgsn_libgtp.c
@@ -234,6 +234,13 @@
 		memcpy(pdp->qos_req.v, qos, pdp->qos_req.l);
 	}
 
+	/* charging characteristics if present */
+	if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) > 0) {
+		OSMO_ASSERT(TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) <= sizeof(pdp->cch_pdp));
+		memcpy(&pdp->cch_pdp, TLVP_VAL(tp, OSMO_IE_GSM_CHARG_CHAR),
+			TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR));
+	}
+
 	/* SGSN address for control plane */
 	pdp->gsnlc.l = sizeof(sgsn->cfg.gtp_listenaddr.sin_addr);
 	memcpy(pdp->gsnlc.v, &sgsn->cfg.gtp_listenaddr.sin_addr,