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

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

Harald Welte has posted comments on this change. ( )

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

Patch Set 2:

(1 comment)
File src/gprs/gprs_llc.c:
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. = 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
To unsubscribe, or for help writing mail filters, visit

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>
Gerrit-Reviewer: Harald Welte <laforge at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Keith Whyte <keith at>
Gerrit-CC: Pau Espin Pedrol <pespin at>
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: <>

More information about the gerrit-log mailing list