pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/29336 )
Change subject: hnb_context_release(): Make sure assigned conn is freed
......................................................................
hnb_context_release(): Make sure assigned conn is freed
Otherwise, some paths calling hnb_context_release() (like failing to
transmit HNB-REGISTER-REJECT) would end up with a conn object alive with
no assigned hnb_context, which is something not wanted.
This way life conn object always has an associated hnb_context, and they
are only disassociated during synchronous release path.
Related: OS#5676
Change-Id: I44fea7ec74f14e0458861c92da4acf685ff695c1
---
M src/osmo-hnbgw/hnbgw.c
1 file changed, 13 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/36/29336/1
diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index 3e94e7f..15f3d27 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -300,9 +300,14 @@
static int hnb_closed_cb(struct osmo_stream_srv *conn)
{
struct hnb_context *hnb = osmo_stream_srv_get_data(conn);
+ if (!hnb)
+ return 0; /* hnb_context is being freed, nothing do be done */
- if (hnb)
- hnb_context_release(hnb);
+ /* hnb: conn became broken, let's release the associated hnb.
+ * conn object is being freed after closed_cb(), so unassign it from hnb
+ * if available to avoid it freeing it again: */
+ hnb->conn = NULL;
+ hnb_context_release(hnb);
return 0;
}
@@ -364,7 +369,12 @@
context_map_deactivate(map);
}
ue_context_free_by_hnb(ctx->gw, ctx);
- osmo_stream_srv_set_data(ctx->conn, NULL);
+
+ if (ctx->conn) { /* we own a conn, we must free it: */
+ /* Avoid our closed_cb to call hnb_context_release() again: */
+ osmo_stream_srv_set_data(ctx->conn, NULL);
+ osmo_stream_srv_destroy(ctx->conn);
+ } /* else: we are called from closed_cb, so conn is being freed separately */
talloc_free(ctx);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29336
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I44fea7ec74f14e0458861c92da4acf685ff695c1
Gerrit-Change-Number: 29336
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/29332
to look at the new patch set (#2).
Change subject: hnbgw_rx_hnb_deregister: Don't call hnb_context_release()
......................................................................
hnbgw_rx_hnb_deregister: Don't call hnb_context_release()
Don't release the HNB context as there's plenty of code that
assumes there's always a HNB context associated with a SCTP connection.
Instead, simply unset the hnb_registered flag in the context when
processing a HNB_DE-REGISTER.
Related: OS#5676
Change-Id: Id5c4f5c900ea049f54afbf58edb84b4dc00b1dcb
---
M include/osmocom/hnbgw/hnbgw.h
M src/osmo-hnbgw/hnbgw_hnbap.c
2 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/32/29332/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29332
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Id5c4f5c900ea049f54afbf58edb84b4dc00b1dcb
Gerrit-Change-Number: 29332
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29335 )
Change subject: stream: Unset fd value after close() before calling closed_cb()
......................................................................
stream: Unset fd value after close() before calling closed_cb()
The fd is not valid anymore after close() call, so let's set it to a
clearly invalid value, to avoid confusion on closed_cb() users
attempting to use the fd get info about the socket at that time.
Change-Id: I82d9bdfb38cf5e9f689eca0d9a4c19ddd5541af7
---
M src/stream.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/35/29335/1
diff --git a/src/stream.c b/src/stream.c
index f090c4f..bc209af 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -1439,8 +1439,9 @@
* \param[in] conn Stream Server to be destroyed */
void osmo_stream_srv_destroy(struct osmo_stream_srv *conn)
{
- close(conn->ofd.fd);
osmo_fd_unregister(&conn->ofd);
+ close(conn->ofd.fd);
+ conn->ofd.fd = -1;
if (conn->closed_cb)
conn->closed_cb(conn);
msgb_queue_free(&conn->tx_queue);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29335
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I82d9bdfb38cf5e9f689eca0d9a4c19ddd5541af7
Gerrit-Change-Number: 29335
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29010 )
Change subject: bsc: Add testscase & infra to validate Osmux support BTS<->BSC
......................................................................
Patch Set 7:
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29010/comment/77dcf1ef_221d…
PS6, Line 13: sides (towards BTS and CN).
> sure, but in the end something must be chosen/done :)
right. the alternative would be renaming the old test, and giving the new test a different name than the old test that also fits... but I don't think it's worth it.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29010
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I6e82eb9d995de988b812001e1c4cf6923509de66
Gerrit-Change-Number: 29010
Gerrit-PatchSet: 7
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 13 Sep 2022 10:15:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment