From 4146121cc996bed1fb1707a2ab8bca6786cd054d Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 12 Apr 2019 17:01:32 +0200 Subject: LLC: Don't use hard-coded N201-U / N201-I values in XID The N201 values are negotiated per SAPI, and there are default values per each SAPI. Let's use those rather than hard-coded values. Closes: OS#3954 Change-Id: I447a3c6dd85311772a6e219c62dc820d2726857f --- src/sgsn/gprs_llc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sgsn/gprs_llc.c b/src/sgsn/gprs_llc.c index ed5d55ef6..6e22e65c0 100644 --- a/src/sgsn/gprs_llc.c +++ b/src/sgsn/gprs_llc.c @@ -69,17 +69,20 @@ static int gprs_llc_generate_xid(uint8_t *bytes, int bytes_len, struct gprs_llc_xid_field xid_version; struct gprs_llc_xid_field xid_n201u; struct gprs_llc_xid_field xid_n201i; + uint16_t n201_u, n201_i; xid_version.type = GPRS_LLC_XID_T_VERSION; xid_version.data = (uint8_t *) "\x00"; xid_version.data_len = 1; + n201_u = htons(lle->params.n201_u); xid_n201u.type = GPRS_LLC_XID_T_N201_U; - xid_n201u.data = (uint8_t *) "\x05\xf0"; + xid_n201u.data = (uint8_t *) &n201_u; xid_n201u.data_len = 2; + n201_i = htons(lle->params.n201_i); xid_n201i.type = GPRS_LLC_XID_T_N201_I; - xid_n201i.data = (uint8_t *) "\x05\xf0"; + xid_n201i.data = (uint8_t *) &n201_i; xid_n201i.data_len = 2; /* Add locally managed XID Fields */ -- cgit v1.2.3