Change in libosmocore[master]: gprs_ns2: fix check of MTU changes for frame relay

laforge gerrit-no-reply at lists.osmocom.org
Mon Jul 5 12:06:18 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/24825 )

Change subject: gprs_ns2: fix check of MTU changes for frame relay
......................................................................

gprs_ns2: fix check of MTU changes for frame relay

The frame relay needs 2 byte for data packets.

Related: OS#5192
Change-Id: I02d4e81896a473aeb79ea2f2983e12324244048f
---
M src/gb/gprs_ns2_fr.c
1 file changed, 7 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  daniel: Looks good to me, but someone else must approve
  pespin: Looks good to me, but someone else must approve



diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 3113b00..35e0dd9 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -601,14 +601,18 @@
 	struct priv_bind *bpriv = bind->priv;
 	struct gprs_ns2_nse *nse;
 
+	/* 2 byte DLCI header */
+	if (mtu <= 2)
+		return;
+	mtu -= 2;
+
 	if (mtu == bind->mtu)
 		return;
 
 	LOGBIND(bind, LOGL_INFO, "MTU changed from %d to %d.\n",
-		bind->mtu, mtu);
+		bind->mtu + 2, mtu + 2);
 
-	/* 2 byte DLCI header */
-	bind->mtu = mtu - 2;
+	bind->mtu = mtu;
 	if (!bpriv->if_running)
 		return;
 

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I02d4e81896a473aeb79ea2f2983e12324244048f
Gerrit-Change-Number: 24825
Gerrit-PatchSet: 4
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210705/ebac5a5a/attachment.htm>


More information about the gerrit-log mailing list