This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Harald Welte gerrit-no-reply at lists.osmocom.orgHello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/2304
to look at the new patch set (#2).
osmo_ss7: When destroying an AS or a linkset, delete all routes
When we destroy a linkset, it make sense to remove all associated routes
pointing to the linkset, as they would point to nowhere anyway.
Change-Id: I393400bc758c28997e16bc78e3142719b6a61be8
---
M src/osmo_ss7.c
1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/04/2304/2
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index cf1948d..e79d721 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -453,11 +453,18 @@
* \param[in] lset Linkset to be destroyed */
void osmo_ss7_linkset_destroy(struct osmo_ss7_linkset *lset)
{
+ struct osmo_ss7_route *rt, *rt2;
unsigned int i;
OSMO_ASSERT(ss7_initialized);
LOGSS7(lset->inst, LOGL_INFO, "Destroying Linkset %s\n",
lset->cfg.name);
+
+ /* find any routes pointing to this AS and remove them */
+ llist_for_each_entry_safe(rt, rt2, &lset->inst->rtable_system->routes, list) {
+ if (rt->dest.linkset == lset)
+ osmo_ss7_route_destroy(rt);
+ }
for (i = 0; i < ARRAY_SIZE(lset->links); i++) {
struct osmo_ss7_link *link = lset->links[i];
@@ -853,12 +860,20 @@
* \param[in] as Application Server to destroy */
void osmo_ss7_as_destroy(struct osmo_ss7_as *as)
{
+ struct osmo_ss7_route *rt, *rt2;
+
OSMO_ASSERT(ss7_initialized);
LOGSS7(as->inst, LOGL_INFO, "Destroying AS %s\n", as->cfg.name);
if (as->fi)
osmo_fsm_inst_term(as->fi, OSMO_FSM_TERM_REQUEST, NULL);
+ /* find any routes pointing to this AS and remove them */
+ llist_for_each_entry_safe(rt, rt2, &as->inst->rtable_system->routes, list) {
+ if (rt->dest.as == as)
+ osmo_ss7_route_destroy(rt);
+ }
+
as->inst = NULL;
llist_del(&as->list);
talloc_free(as);
--
To view, visit https://gerrit.osmocom.org/2304
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I393400bc758c28997e16bc78e3142719b6a61be8
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder