From db142dc59dc8d79d8ee608c9165bc865d240b97d Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 22 Dec 2016 14:15:20 +0100 Subject: sndcp: Allow empty SNDCP-XID indications In some rare cases the modem might send a xid indication that does not contain anything except the version number field. The sgsn ignors such SNDCP-XID indications by stripping the entire field from the response. We found a modem in the wild that started to act problematic when the empty SNDCP-XID was missing in the response. This patch changes the XID negotiation behaviour in a way that if a modem should send empty SNDCP-XID indications, the reply will also contain an empty SNDCP-XID indication. Apart from that the SNDCP-XID version number is now parsed and echoed in the response. This ensures that we always reply with the version number that the modem expects. (The version was 0 in all cases we observed so far) Change-Id: I097a770cb4907418f53e620a051ebb8cd110c5f2 Related: OS#1794 --- openbsc/include/openbsc/gprs_sndcp_xid.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'openbsc/include/openbsc/gprs_sndcp_xid.h') diff --git a/openbsc/include/openbsc/gprs_sndcp_xid.h b/openbsc/include/openbsc/gprs_sndcp_xid.h index 02904a7d2..e64bc5237 100644 --- a/openbsc/include/openbsc/gprs_sndcp_xid.h +++ b/openbsc/include/openbsc/gprs_sndcp_xid.h @@ -24,7 +24,7 @@ #include #include -#define CURRENT_SNDCP_VERSION 0 /* See 3GPP TS 44.065, clause 8 */ +#define DEFAULT_SNDCP_VERSION 0 /* See 3GPP TS 44.065, clause 8 */ #define MAX_ENTITIES 32 /* 3GPP TS 44.065 reserves 5 bit * for compression enitity number */ @@ -197,13 +197,15 @@ enum gprs_sndcp_dcomp_v44_dcomp { /* Transform a list with compression fields into an SNDCP-XID message (dst) */ int gprs_sndcp_compile_xid(uint8_t *dst, unsigned int dst_maxlen, - const struct llist_head *comp_fields); + const struct llist_head *comp_fields, int version); /* Transform an SNDCP-XID message (src) into a list of SNDCP-XID fields */ -struct llist_head *gprs_sndcp_parse_xid(const void *ctx, - const uint8_t * src, - unsigned int src_len, - const struct llist_head *comp_fields_req); +struct llist_head *gprs_sndcp_parse_xid(int *version, + const void *ctx, + const uint8_t *src, + unsigned int src_len, + const struct llist_head + *comp_fields_req); /* Find out to which compression class the specified comp-field belongs * (header compression or data compression?) */ -- cgit v1.2.3