aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2012-09-23 06:42:38 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2012-09-23 06:42:38 +0200
commit9a91346fa12b93e1dbfc0c5d07c28061bd71545f (patch)
tree89d969e27b8552f23571635130acd508d555c741 /src
parent514491d726008b45d3caaa8fb36e55bc2ff8311b (diff)
Fix: Send correct QOS profile and DL-UNITDATA IE to SGSN
Be sure to use always two bytes of length information for DL-UNITDATA, even if the length of LLC data is less than 128 bytes. This way the data has always the same offset from a 32 bit boundary.
Diffstat (limited to 'src')
-rw-r--r--src/gprs_rlcmac.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp
index cfd3ad9f..f7ec8477 100644
--- a/src/gprs_rlcmac.cpp
+++ b/src/gprs_rlcmac.cpp
@@ -1512,7 +1512,7 @@ unsigned write_repeated_page_info(bitvec * dest, unsigned& wp, uint8_t len,
/* Send Uplink unit-data to SGSN. */
int gprs_rlcmac_tx_ul_ud(gprs_rlcmac_tbf *tbf)
{
- const uint8_t qos_profile = QOS_PROFILE;
+ uint8_t qos_profile[3];
struct msgb *llc_pdu;
unsigned msg_len = NS_HDR_LEN + BSSGP_HDR_LEN + tbf->llc_index;
@@ -1523,8 +1523,12 @@ int gprs_rlcmac_tx_ul_ud(gprs_rlcmac_tbf *tbf)
}
llc_pdu = msgb_alloc_headroom(msg_len, msg_len,"llc_pdu");
- msgb_tvlv_push(llc_pdu, BSSGP_IE_LLC_PDU, sizeof(uint8_t)*tbf->llc_index, tbf->llc_frame);
- bssgp_tx_ul_ud(bctx, tbf->tlli, &qos_profile, llc_pdu);
+ uint8_t *buf = msgb_push(llc_pdu, TL16V_GROSS_LEN(sizeof(uint8_t)*tbf->llc_index));
+ tl16v_put(buf, BSSGP_IE_LLC_PDU, sizeof(uint8_t)*tbf->llc_index, tbf->llc_frame);
+ qos_profile[0] = QOS_PROFILE >> 16;
+ qos_profile[1] = QOS_PROFILE >> 8;
+ qos_profile[2] = QOS_PROFILE;
+ bssgp_tx_ul_ud(bctx, tbf->tlli, qos_profile, llc_pdu);
return 0;
}