osmith has uploaded this change for review.

View Change

gtp: allow packets with E-bit set

Do not drop packets early that have the bit for indicating presence of
next extension header set ("Unsupported packet flags 0x36").

With this patch, a packet with extension header gets into the "Check for
extension headers" code path. There the GGSN currently rejects all such
packages with an "Unsupported extension header" error log message, and
sends a Supported Extension Headers Notification to the SGSN.

Related: OS#6223
Change-Id: Ic62f95874a877a2f295765b807d7f23b011aeaa3
---
M gtp/gtp.c
1 file changed, 7 insertions(+), 2 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/83/38383/1
diff --git a/gtp/gtp.c b/gtp/gtp.c
index 02cf8a3..41a70ef 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -2992,8 +2992,13 @@
continue;
}

- /* Check packet flag field (allow both with and without sequence number) */
- if (((pheader->flags & 0xf5) != 0x30)) {
+ /* Check packet flag field (3GPP TS 29.060 ยง 6.1)
+ * Bitmask allows for 0 or 1 in:
+ * 0x02 S: sequence number
+ * 0x04 E: presence of next extension header
+ * 0x08 *: spare bit
+ * */
+ if (((pheader->flags & 0xf1) != 0x30)) {
rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNSUP);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status, "Unsupported packet flags 0x%02x\n", pheader->flags);

To view, visit change 38383. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: Ic62f95874a877a2f295765b807d7f23b011aeaa3
Gerrit-Change-Number: 38383
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>