Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13764 )

Change subject: LLC: Don't blindly assume all LLC frames have data payload
......................................................................


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/13764/2/src/gprs/gprs_llc.c
File src/gprs/gprs_llc.c:

https://gerrit.osmocom.org/#/c/13764/2/src/gprs/gprs_llc.c@961
PS2, Line 961:          /* set l3 layer & remove the fcs */
> so do we need the fcs for kind of messages where there's not l3? […]
there is FCS in any LLC frame, as the FCS covers both header and payload, right?

The problam is not setting msg->l3h to NULL.  The problem is to then call a 
msgb_l3trim() on a msgb that has l3h set to ?NULL.  Of course we could also 
make msgb_l3trim() handle the l3 case == NULL.  But I actually think that would 
 be hiding unintended behavior.  If at all, I would make msgb_l3trim() ASSERT 
in case somebody passes a msgb with l3h = NULL.

The only thing that one *could* improve here is to remove the 3 byte FCS even 
for those messages without user data (i.e. llhp.data = NULL).  Right now we 
don't do that, but then any downstream code (even future one) doesn't care on 
what's in the msgb, as the only relevant information is in the already-parsed 
llhp.



--
To view, visit https://gerrit.osmocom.org/13764
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: I51bbd0f2c618d477a037af343ff41de1c8a5a3ae
Gerrit-Change-Number: 13764
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Keith Whyte <[email protected]>
Gerrit-CC: Pau Espin Pedrol <[email protected]>
Gerrit-Comment-Date: Wed, 24 Apr 2019 07:50:26 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No

Reply via email to