Change in osmo-sgsn[master]: LLC: Don't blindly assume all LLC frames have data payload

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Apr 24 07:50:26 UTC 2019


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 <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Keith Whyte <keith at rhizomatica.org>
Gerrit-CC: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Comment-Date: Wed, 24 Apr 2019 07:50:26 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190424/69e81fa1/attachment.html>


More information about the gerrit-log mailing list