Change in osmo-sgsn[master]: gprs_llc: remove the FCS from the msgb by trim'ing the msgb

2018-10-04 Thread lynxis lazus
lynxis lazus has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11022 )

Change subject: gprs_llc: remove the FCS from the msgb by trim'ing the msgb
..

gprs_llc: remove the FCS from the msgb by trim'ing the msgb

After checking the FCS, it's no use. The FCS should also not
appear on `hexdump(msgb_l3(MSG), msgb_l3len(MSG))`.

Change-Id: I27e061ead86395a336b67c7aead93d305a0f2ae8
---
M src/gprs/gprs_llc.c
M src/gprs/gprs_sndcp.c
2 files changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c
index 6c92f83..abbb742 100644
--- a/src/gprs/gprs_llc.c
+++ b/src/gprs/gprs_llc.c
@@ -945,6 +945,9 @@
LOGP(DLLC, LOGL_INFO, "Dropping frame with invalid FCS\n");
return -EIO;
}
+   /* set l3 layer & remove the fcs */
+   msg->l3h = llhp.data;
+   msgb_l3trim(msg, llhp.data_len);

/* Update LLE's (BVCI, NSEI) tuple */
lle->llme->bvci = msgb_bvci(msg);
@@ -960,7 +963,6 @@

/* llhp.data is only set when we need to send LL_[UNIT]DATA_IND up */
if (llhp.cmd == GPRS_LLC_UI && llhp.data && llhp.data_len) {
-   msgb_gmmh(msg) = llhp.data;
switch (llhp.sapi) {
case GPRS_SAPI_GMM:
/* send LL_UNITDATA_IND to GMM */
diff --git a/src/gprs/gprs_sndcp.c b/src/gprs/gprs_sndcp.c
index 77f8ca6..52eeb75 100644
--- a/src/gprs/gprs_sndcp.c
+++ b/src/gprs/gprs_sndcp.c
@@ -792,7 +792,7 @@

npdu_num = (suh->npdu_high << 8) | suh->npdu_low;
npdu = (uint8_t *)suh + sizeof(*suh);
-   npdu_len = (msg->data + msg->len) - npdu - 3;   /* -3 'removes' the FCS 
*/
+   npdu_len = (msg->data + msg->len) - npdu;

if (npdu_len <= 0) {
LOGP(DSNDCP, LOGL_ERROR, "Short SNDCP N-PDU: %d\n", npdu_len);

--
To view, visit https://gerrit.osmocom.org/11022
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I27e061ead86395a336b67c7aead93d305a0f2ae8
Gerrit-Change-Number: 11022
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: lynxis lazus 


Change in osmo-sgsn[master]: gprs_llc: remove the FCS from the msgb by trim'ing the msgb

2018-10-04 Thread lynxis lazus
lynxis lazus has posted comments on this change. ( 
https://gerrit.osmocom.org/11022 )

Change subject: gprs_llc: remove the FCS from the msgb by trim'ing the msgb
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/11022
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I27e061ead86395a336b67c7aead93d305a0f2ae8
Gerrit-Change-Number: 11022
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: lynxis lazus 
Gerrit-Comment-Date: Thu, 04 Oct 2018 08:28:15 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-sgsn[master]: gprs_llc: remove the FCS from the msgb by trim'ing the msgb

2018-09-18 Thread lynxis lazus
lynxis lazus has uploaded this change for review. ( 
https://gerrit.osmocom.org/11022


Change subject: gprs_llc: remove the FCS from the msgb by trim'ing the msgb
..

gprs_llc: remove the FCS from the msgb by trim'ing the msgb

After checking the FCS, it's no use. The FCS should also not
appear on `hexdump(msgb_l3(MSG), msgb_l3len(MSG))`.

Change-Id: I27e061ead86395a336b67c7aead93d305a0f2ae8
---
M src/gprs/gprs_llc.c
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/22/11022/1

diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c
index 6c92f83..abbb742 100644
--- a/src/gprs/gprs_llc.c
+++ b/src/gprs/gprs_llc.c
@@ -945,6 +945,9 @@
LOGP(DLLC, LOGL_INFO, "Dropping frame with invalid FCS\n");
return -EIO;
}
+   /* set l3 layer & remove the fcs */
+   msg->l3h = llhp.data;
+   msgb_l3trim(msg, llhp.data_len);

/* Update LLE's (BVCI, NSEI) tuple */
lle->llme->bvci = msgb_bvci(msg);
@@ -960,7 +963,6 @@

/* llhp.data is only set when we need to send LL_[UNIT]DATA_IND up */
if (llhp.cmd == GPRS_LLC_UI && llhp.data && llhp.data_len) {
-   msgb_gmmh(msg) = llhp.data;
switch (llhp.sapi) {
case GPRS_SAPI_GMM:
/* send LL_UNITDATA_IND to GMM */

--
To view, visit https://gerrit.osmocom.org/11022
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I27e061ead86395a336b67c7aead93d305a0f2ae8
Gerrit-Change-Number: 11022
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus