canghaiwuhen has uploaded a new patch set (#3). ( https://gerrit.osmocom.org/c/osmo-sgsn/+/42050?usp=email )
Change subject: Some older modules, such as the Air20X module, may crash during PDP attachment due to excessively long QoS response packets. If the PDP is not released after successful attachment, the module will restart, and subsequent TCP connections will fail.
......................................................................
Some older modules, such as the Air20X module, may crash during PDP attachment due to excessively long QoS response packets.
If the PDP is not released after successful attachment, the module will restart, and subsequent TCP connections will fail.
Related: OS#6922
Change-Id: I11c24b64f0e49cf80c825969dbf018b2948d855c
---
M src/sgsn/gprs_gmm.c
M src/sgsn/gprs_sm.c
2 files changed, 29 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/50/42050/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/42050?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I11c24b64f0e49cf80c825969dbf018b2948d855c
Gerrit-Change-Number: 42050
Gerrit-PatchSet: 3
Gerrit-Owner: canghaiwuhen <canghaiwuhen(a)gmail.com>
Gerrit-CC: Jenkins Builder
canghaiwuhen has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-sgsn/+/42050?usp=email )
Change subject: Some older modules, such as the Air20X module, may crash during PDP attachment due to excessively long QoS response packets. If the PDP is not released after successful attachment, the module will restart, and subsequent TCP connections will fail.
......................................................................
Some older modules, such as the Air20X module, may crash during PDP attachment due to excessively long QoS response packets. If the PDP is not released after successful attachment, the module will restart, and subsequent TCP connections will fail.
Related: OS#6922
Change-Id: I11c24b64f0e49cf80c825969dbf018b2948d855c
---
M src/sgsn/gprs_gmm.c
M src/sgsn/gprs_sm.c
2 files changed, 29 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/50/42050/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/42050?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I11c24b64f0e49cf80c825969dbf018b2948d855c
Gerrit-Change-Number: 42050
Gerrit-PatchSet: 2
Gerrit-Owner: canghaiwuhen <canghaiwuhen(a)gmail.com>
Gerrit-CC: Jenkins Builder
canghaiwuhen has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/42050?usp=email )
Change subject: Related: OS#6922
......................................................................
Related: OS#6922
Some older modules, such as the Air20X module, may crash during PDP attachment due to excessively long QoS response packets. If the PDP is not released after successful attachment, the module will restart, and subsequent TCP connections will fail.
Change-Id: I11c24b64f0e49cf80c825969dbf018b2948d855c
---
M src/sgsn/gprs_gmm.c
M src/sgsn/gprs_sm.c
2 files changed, 29 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/50/42050/1
diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c
index 3d4b940..ce77d35 100644
--- a/src/sgsn/gprs_gmm.c
+++ b/src/sgsn/gprs_gmm.c
@@ -1336,7 +1336,15 @@
goto rejected;
}
OSMO_STRLCPY_ARRAY(ctx->imsi, mi.imsi);
- }
+ } else {
+ /* [FIX] Known IMSI context. If the module initiates an Attach, it means it has restarted and lost its PDP state.
+ * We must clean up the old PDP context on the SGSN side; otherwise, the SGSN will not recreate them, leading to communication failure. */
+ struct sgsn_pdp_ctx *pdp, *pdp2;
+ llist_for_each_entry_safe(pdp, pdp2, &ctx->pdp_list, list) {
+ LOGMMCTXP(LOGL_NOTICE, ctx, "Re-Attach: Dropping stale PDP context for NSAPI=%u\n", pdp->nsapi);
+ sgsn_pdp_ctx_terminate(pdp);
+ }
+ }
break;
case GSM_MI_TYPE_TMSI:
/* Try to find MM context based on P-TMSI */
@@ -1354,7 +1362,14 @@
goto rejected;
}
ctx->p_tmsi = mi.tmsi;
- }
+ } else {
+ /* [FIX] Known P-TMSI context. Similarly, if the module re-attaches, clean up the old PDP context. */
+ struct sgsn_pdp_ctx *pdp, *pdp2;
+ llist_for_each_entry_safe(pdp, pdp2, &ctx->pdp_list, list) {
+ LOGMMCTXP(LOGL_NOTICE, ctx, "Re-Attach: Dropping stale PDP context for NSAPI=%u\n", pdp->nsapi);
+ sgsn_pdp_ctx_terminate(pdp);
+ }
+ }
break;
default:
LOGMMCTXP(LOGL_NOTICE, ctx, "Rejecting ATTACH REQUEST with "
diff --git a/src/sgsn/gprs_sm.c b/src/sgsn/gprs_sm.c
index bcf2923..aebebe7 100644
--- a/src/sgsn/gprs_sm.c
+++ b/src/sgsn/gprs_sm.c
@@ -206,7 +206,18 @@
/* FIXME: copy QoS parameters from original request */
//msgb_lv_put(msg, pdp->lib->qos_neg.l, pdp->lib->qos_neg.v);
- msgb_lv_put(msg, sizeof(default_qos), (uint8_t *)&default_qos);
+ //msgb_lv_put(msg, sizeof(default_qos), (uint8_t *)&default_qos);
+
+ /* Use the explicitly stored original Air Interface QoS length (req_qos_len).
+ * Modern modules send 14+ bytes (R99) and expect full responses.
+ * SOLUTION: Reply with exactly the length they asked for.
+ */
+ uint8_t qos_len = sizeof(default_qos);
+ if (pdp->lib && pdp->lib->qos_req.l > 1)
+ qos_len = pdp->lib->qos_req.l - 1;
+ if (qos_len > sizeof(default_qos))
+ qos_len = sizeof(default_qos);
+ msgb_lv_put(msg, qos_len, (uint8_t *)&default_qos);
/* Radio priority 10.5.7.2 */
msgb_v_put(msg, pdp->lib->radio_pri);
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/42050?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I11c24b64f0e49cf80c825969dbf018b2948d855c
Gerrit-Change-Number: 42050
Gerrit-PatchSet: 1
Gerrit-Owner: canghaiwuhen <canghaiwuhen(a)gmail.com>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcap/+/42015?usp=email )
Change subject: server: wr_file: Request up to 8 iofd write buffers if available
......................................................................
server: wr_file: Request up to 8 iofd write buffers if available
Writing to disk is usually slower than handling network traffic, so it's
a desirable to increase write buffers to try to submit our write queue
to the kernel/VFS as fast as possible, to avoid it growing too much.
This should also improve CPU use at the expense of some dozen KBs of
extra use, which in the server should be plenty available.
Using up to 8 buffer sounds like a good start, being it a good
compromise between memory requirements and batching of msgbs. It also
turns outs it's the maximum amount of buffers allowed by osmo_io current
implementation ;)
Depends: libosmocore.git 378cf564c8859311415aa70adeb220cedbe56eb3
Change-Id: I167e5f9b7f9d5693b3df05f713288c741031c532
---
M TODO-RELEASE
M src/osmo_pcap_wr_file.c
2 files changed, 8 insertions(+), 0 deletions(-)
Approvals:
daniel: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 0ed7189..b52b9a8 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,4 @@
# If any interfaces have been added since the last public release: c:r:a + 1.
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
+libosmocore >1.12.1 osmo_iofd_set_io_buffers(..., 0) returning maximum available write buffer value.
diff --git a/src/osmo_pcap_wr_file.c b/src/osmo_pcap_wr_file.c
index d60c5a7..3510c59 100644
--- a/src/osmo_pcap_wr_file.c
+++ b/src/osmo_pcap_wr_file.c
@@ -125,7 +125,14 @@
&ioops, wrf);
if (!wrf->local_iofd)
return -EBADFD;
+
osmo_iofd_set_txqueue_max_length(wrf->local_iofd, wrf->wr_queue_max_length);
+
+ /* Request to use 8 write buffers, or less if not as many are available: */
+ rc = osmo_iofd_set_io_buffers(wrf->local_iofd, OSMO_IO_OP_WRITE, 0);
+ if (rc > 0)
+ osmo_iofd_set_io_buffers(wrf->local_iofd, OSMO_IO_OP_WRITE, OSMO_MIN(rc, 8));
+
if (osmo_iofd_register(wrf->local_iofd, -1) < 0) {
osmo_iofd_free(wrf->local_iofd);
wrf->local_iofd = NULL;
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/42015?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: I167e5f9b7f9d5693b3df05f713288c741031c532
Gerrit-Change-Number: 42015
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria, jolly, pespin.
daniel has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-pcap/+/42015?usp=email )
Change subject: server: wr_file: Request up to 8 iofd write buffers if available
......................................................................
Patch Set 3: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/42015?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: I167e5f9b7f9d5693b3df05f713288c741031c532
Gerrit-Change-Number: 42015
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 04 Feb 2026 14:49:45 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes