path: root/openbsc/include/openbsc/gprs_sndcp_xid.h
diff options
authorPhilipp <pmaier@sysmocom.de>2016-12-22 14:15:20 +0100
committerPhilipp <pmaier@sysmocom.de>2016-12-23 11:19:15 +0100
commitdb142dc59dc8d79d8ee608c9165bc865d240b97d (patch)
treea4c1ec7fdece679b7dd252ac321b28c60e3492d2 /openbsc/include/openbsc/gprs_sndcp_xid.h
parenta191dcd8f01767b266b85578d0fb445d864dfabd (diff)
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
Diffstat (limited to 'openbsc/include/openbsc/gprs_sndcp_xid.h')
1 files changed, 8 insertions, 6 deletions
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 <stdint.h>
#include <osmocom/core/linuxlist.h>
-#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?) */