osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39405?usp=email )
Change subject: testenv: run: add --autoreconf-in-src-copy arg
......................................................................
testenv: run: add --autoreconf-in-src-copy arg
Add a new argument that avoids the problem that ./configure refuses to
run if it has already been executed in the source dir. (It aborts and
asks the user to run "make distclean" first, which is especially
annoying if it has to be done in multiple source dirs before being able
to build successfully.)
Put the new logic behind am "experimental argument" for now. I think it
improves usability greatly and plan to make it the default later when
it has been well tested.
I have also considered making the source dir read-only when mounted into
podman and this argument is set. This was the original goal of Lynxis'
related patch, on which idea this one is based. But osmo-dev still
needs to write into the source dir in case it clones a new repository,
so making the sources dir read-only with this trade-off should be a
separate flag and could be added in another patch later.
Related: osmo-ttcn3-hacks I0f1ac8852218f158ece14c176f05574f60d9d1f7
Depends: osmo-dev I18ac50e3441df81e1fe7d8d5321df7e80ab9c650
Change-Id: I5c38ce69dc39823d12be574c74a654d2fa6ed8fb
---
M _testenv/testenv/__init__.py
M _testenv/testenv/osmo_dev.py
2 files changed, 17 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/39405/1
diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py
index c1991ca..4a925bb 100644
--- a/_testenv/testenv/__init__.py
+++ b/_testenv/testenv/__init__.py
@@ -170,6 +170,14 @@
default=ccache_dir_default,
)
+ group = sub_run.add_argument_group("experimental options")
+ group.add_argument(
+ "-A",
+ "--autoreconf-in-src-copy",
+ action="store_true",
+ help="run autoreconf in a copy of the source dir, avoids 'run make distclean' errors",
+ )
+
sub.add_parser("clean", help="clean previous build artifacts")
args = parser.parse_args()
diff --git a/_testenv/testenv/osmo_dev.py b/_testenv/testenv/osmo_dev.py
index 51d07a7..8748b93 100644
--- a/_testenv/testenv/osmo_dev.py
+++ b/_testenv/testenv/osmo_dev.py
@@ -73,6 +73,15 @@
os.path.join(testenv.args.cache, "host/usr"),
]
+ if testenv.args.autoreconf_in_src_copy:
+ # Use a different make dir, so we don't have unexpected behavior when
+ # the user already ran autoreconf or ./configure through osmo-dev with
+ # the previous make dir, without --autoreconf-in-src-copy.
+ make_dir += "2"
+ extra_opts += [
+ "--autoreconf-in-src-copy",
+ ]
+
cmd = [
"./gen_makefile.py",
"--build-debug",
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39405?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I5c38ce69dc39823d12be574c74a654d2fa6ed8fb
Gerrit-Change-Number: 39405
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/39399?usp=email )
Change subject: ruff.toml: new file
......................................................................
ruff.toml: new file
Add a ruff.toml config, so "ruff check" can be used in a local
pre-commit hook to find errors like the following. I'll fix them in
follow-up patches. Only checking gen_makefile.py for now as I plan to
modify that in follow-up patches.
gen_makefile.py:147:7: F841 Local variable `l` is assigned to but never used
|
145 | def extend_dict(self, d):
146 | for k,v in d.items():
147 | l = self.extend(k, v)
| ^ F841
148 |
149 | def read_projects_deps(path):
|
= help: Remove assignment to unused variable `l`
Change-Id: If045f3bfc12b333d3426e558294346da83521466
---
A .ruff.toml
1 file changed, 12 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/99/39399/1
diff --git a/.ruff.toml b/.ruff.toml
new file mode 100644
index 0000000..64ca401
--- /dev/null
+++ b/.ruff.toml
@@ -0,0 +1,12 @@
+line-length = 120
+exclude = [
+ "cgit/osmo-commit-filter.py",
+ "net/fill_config.py",
+ "net/templates/freeswitch/python/dialplan-dgsm/__init__.py",
+ "osmo-cn-latest/provision-hlr.py",
+ "sysmobts-calib.py",
+]
+
+[lint]
+# E741: Ambiguous variable name: `l`
+ignore = ["E741"]
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/39399?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: If045f3bfc12b333d3426e558294346da83521466
Gerrit-Change-Number: 39399
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/39400?usp=email )
Change subject: gen_makefile: fix variable assigned but never used
......................................................................
gen_makefile: fix variable assigned but never used
gen_makefile.py:147:7: F841 Local variable `l` is assigned to but never used
gen_makefile.py:313:5: F841 Local variable `target` is assigned to but never used
Change-Id: Ib938d3336d395bfed3e5194dcf86ae5d56f99984
---
M gen_makefile.py
1 file changed, 1 insertion(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/00/39400/1
diff --git a/gen_makefile.py b/gen_makefile.py
index 22882bd..18af686 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -144,7 +144,7 @@
def extend_dict(self, d):
for k,v in d.items():
- l = self.extend(k, v)
+ self.extend(k, v)
def read_projects_deps(path):
'Read deps config and return tuples of (project_name, which-other-to-build-first).'
@@ -310,7 +310,6 @@
touch $@
'''
elif buildsystem == "meson":
- target = "test" if check else "compile"
test_line = ""
# TODO: currently tests don't pass in this env
# if check:
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/39400?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: Ib938d3336d395bfed3e5194dcf86ae5d56f99984
Gerrit-Change-Number: 39400
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39397?usp=email )
Change subject: Pass ownership of Rx xua_msg up the stack [2/2]
......................................................................
Pass ownership of Rx xua_msg up the stack [2/2]
This is the second step patch where we also pass ownership on Rx path so
that forwarded xua_msgs can be passed back to the Tx path without
freeing them.
For SUA there's no change needed and we keep freeing the rx xua_msg
right at the end of sua_rx_msg() since there's no actual path forwarding
a xua_msg object back into Tx path, it always goes through upper layers
using newly allocated primitives.
Change-Id: Icf3b4dda550637f722a9fe56d0313f49c8a2964e
---
M src/ipa.c
M src/m3ua.c
M src/xua_rkm.c
3 files changed, 46 insertions(+), 23 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/97/39397/1
diff --git a/src/ipa.c b/src/ipa.c
index 944fbce..ac0cf3a 100644
--- a/src/ipa.c
+++ b/src/ipa.c
@@ -300,9 +300,9 @@
/* Update xua->mtp with values from data_hdr */
m3ua_dh_to_xfer_param(&xua->mtp, &data_hdr);
- /* Pass on as if we had received it from an M3UA ASP */
+ /* Pass on as if we had received it from an M3UA ASP.
+ * xua ownsership is passed here: */
rc = m3ua_hmdc_rx_from_l2(asp->inst, xua);
- xua_msg_free(xua);
return rc;
}
diff --git a/src/m3ua.c b/src/m3ua.c
index dbdd4e2..69910fb 100644
--- a/src/m3ua.c
+++ b/src/m3ua.c
@@ -566,6 +566,7 @@
return data_hdr;
}
+/* This function takes ownership of xua msg passed to it. */
static int m3ua_rx_xfer(struct osmo_ss7_asp *asp, struct xua_msg *xua)
{
struct xua_msg_part *na_ie = xua_msg_find_tag(xua, M3UA_IEI_NET_APPEAR);
@@ -581,7 +582,8 @@
"%s(): unsupported message type: %s\n",
__func__,
get_value_string(m3ua_xfer_msgt_names, xua->hdr.msg_type));
- return M3UA_ERR_UNSUPP_MSG_TYPE;
+ rc = M3UA_ERR_UNSUPP_MSG_TYPE;
+ goto ret_free;
}
/* Reject unsupported Network Appearance IE. */
@@ -592,13 +594,15 @@
"Unsupported 'Network Appearance' IE '0x%08x' in message type '%s', sending 'Error'.\n",
na, get_value_string(m3ua_xfer_msgt_names, xua->hdr.msg_type));
if (na_ie->len != 4)
- return M3UA_ERR_PARAM_FIELD_ERR;
- return M3UA_ERR_INVAL_NET_APPEAR;
+ rc = M3UA_ERR_PARAM_FIELD_ERR;
+ else
+ rc = M3UA_ERR_INVAL_NET_APPEAR;
+ goto ret_free;
}
rc = xua_find_as_for_asp(&as, asp, rctx_ie);
if (rc)
- return rc;
+ goto ret_free;
rate_ctr_inc2(as->ctrg, SS7_AS_CTR_RX_MSU_TOTAL);
@@ -620,8 +624,12 @@
xua_msg_free_tag(xua, M3UA_IEI_ROUTE_CTX);
}
+ /* xua ownsership is passed here: */
return m3ua_hmdc_rx_from_l2(asp->inst, xua);
- /* xua will be freed by caller m3ua_rx_msg() */
+
+ret_free:
+ xua_msg_free(xua);
+ return rc;
}
static int m3ua_rx_mgmt_err(struct osmo_ss7_asp *asp, struct xua_msg *xua)
@@ -681,16 +689,24 @@
return 0;
}
+/* This function takes ownership of xua msg passed to it. */
static int m3ua_rx_mgmt(struct osmo_ss7_asp *asp, struct xua_msg *xua)
{
+ int rc;
+
switch (xua->hdr.msg_type) {
case M3UA_MGMT_ERR:
- return m3ua_rx_mgmt_err(asp, xua);
+ rc = m3ua_rx_mgmt_err(asp, xua);
+ break;
case M3UA_MGMT_NTFY:
- return m3ua_rx_mgmt_ntfy(asp, xua);
+ rc = m3ua_rx_mgmt_ntfy(asp, xua);
+ break;
default:
- return M3UA_ERR_UNSUPP_MSG_TYPE;
+ rc = M3UA_ERR_UNSUPP_MSG_TYPE;
}
+
+ xua_msg_free(xua);
+ return rc;
}
/* map from M3UA ASPSM/ASPTM to xua_asp_fsm event */
@@ -707,23 +723,26 @@
{ M3UA_MSGC_ASPTM, M3UA_ASPTM_INACTIVE_ACK, XUA_ASP_E_ASPTM_ASPIA_ACK },
};
-
+/* This function takes ownership of xua msg passed to it. */
static int m3ua_rx_asp(struct osmo_ss7_asp *asp, struct xua_msg *xua)
{
int event;
+ int rc = 0;
/* map from the M3UA message class and message type to the XUA
* ASP FSM event number */
event = xua_msg_event_map(xua, m3ua_aspxm_map,
ARRAY_SIZE(m3ua_aspxm_map));
- if (event < 0)
- return M3UA_ERR_UNSUPP_MSG_TYPE;
+ if (event < 0) {
+ rc = M3UA_ERR_UNSUPP_MSG_TYPE;
+ goto ret_free;
+ }
/* deliver that event to the ASP FSM */
- if (osmo_fsm_inst_dispatch(asp->fi, event, xua) < 0)
- return M3UA_ERR_UNEXPECTED_MSG;
-
- return 0;
+ rc = osmo_fsm_inst_dispatch(asp->fi, event, xua);
+ret_free:
+ xua_msg_free(xua);
+ return rc;
}
static int m3ua_rx_snm(struct osmo_ss7_asp *asp, struct xua_msg *xua);
@@ -804,8 +823,6 @@
if (err)
m3ua_tx_xua_asp(asp, err);
- xua_msg_free(xua);
-
return rc;
}
@@ -955,7 +972,8 @@
m3ua_tx_xua_asp(asp, xua);
}
-/* received SNM message on ASP side */
+/* received SNM message on ASP side
+ * This function takes ownership of xua msg passed to it. */
static int m3ua_rx_snm_asp(struct osmo_ss7_asp *asp, struct xua_msg *xua)
{
struct osmo_ss7_as *as = NULL;
@@ -964,7 +982,7 @@
rc = xua_find_as_for_asp(&as, asp, rctx_ie);
if (rc)
- return rc;
+ goto ret_free;
/* report those up the stack so both other ASPs and local SCCP users can be notified */
switch (xua->hdr.msg_type) {
@@ -1001,7 +1019,9 @@
return M3UA_ERR_UNSUPP_MSG_TYPE;
}
- return 0;
+ret_free:
+ xua_msg_free(xua);
+ return rc;
}
/* received SNM message on SG side */
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index 9a3918e..73461ec 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -532,7 +532,8 @@
return 0;
}
-/* process an incoming RKM message in xua format */
+/* process an incoming RKM message in xua format
+ * This function takes ownership of xua msg passed to it. */
int m3ua_rx_rkm(struct osmo_ss7_asp *asp, struct xua_msg *xua)
{
int rc;
@@ -562,6 +563,8 @@
rc = -1;
break;
}
+
+ xua_msg_free(xua);
return rc;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39397?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Icf3b4dda550637f722a9fe56d0313f49c8a2964e
Gerrit-Change-Number: 39397
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39396?usp=email )
Change subject: Pass ownership of Tx xua_msg down the stack [1/2]
......................................................................
Pass ownership of Tx xua_msg down the stack [1/2]
This is a first step towards getting MTP OPC & SLS fields down the stack
so that they can be used to implement loadsharing at ASP level.
So far, we always encode the xua_msg (which holds the OPC and SLS info
into xua_msg->mtp) into a msgb before passing it to as->fi through event
XUA_AS_E_TRANSFER_REQ, which in turn calls xua_as_transmit_msg(as, msg).
This patch is part 1 of 2 patches, which only modifies mostly the
Tx path, but still requires modifications on Rx path (done in patch 2/2)
to properly handle the forwarding path from Rx to Tx without double
freeing. It is submitted in 2 parts to ease code reviewing.
Future patches will modify that code to pass a xua_msg and only
encode it into a msgb deeper into the stack after an ASP has been
selected and msg needs to be transmitted.
All previous calls to sua_tx_xua_asp() actually had a memory leak before
this change, hence why no xua_msg_free() is removed from callers in this
patch. Since now ownership is taken by sua_tx_xua_asp() which always
frees the xua msg, the memleak is fixed.
Change-Id: I49e718e624da08510a9c3d28bdb360c59f9a65d3
---
M src/ipa.c
M src/m3ua.c
M src/osmo_ss7_hmrt.c
M src/sua.c
4 files changed, 49 insertions(+), 19 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/96/39396/1
diff --git a/src/ipa.c b/src/ipa.c
index 6ca5b50..944fbce 100644
--- a/src/ipa.c
+++ b/src/ipa.c
@@ -94,13 +94,17 @@
/*! \brief Send a given xUA message via a given IPA "Application Server"
* \param[in] as Application Server through which to send \a xua
* \param[in] xua xUA message to be sent
- * \return 0 on success; negative on error */
+ * \return 0 on success; negative on error
+ *
+ * This function takes ownership of xua msg passed to it.
+ */
int ipa_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua)
{
struct msgb *msg;
OSMO_ASSERT(as->cfg.proto == OSMO_SS7_ASP_PROT_IPA);
msg = ipa_to_msg(xua);
+ xua_msg_free(xua);
if (!msg) {
LOGPAS(as, DLSS7, LOGL_ERROR, "Error encoding IPA Msg\n");
return -1;
diff --git a/src/m3ua.c b/src/m3ua.c
index 5f94674..dbdd4e2 100644
--- a/src/m3ua.c
+++ b/src/m3ua.c
@@ -493,23 +493,31 @@
return msg;
}
-/* transmit given xua_msg via given ASP */
+/* transmit given xua_msg via given ASP
+ * This function takes ownership of xua msg passed to it.
+ */
static int m3ua_tx_xua_asp(struct osmo_ss7_asp *asp, struct xua_msg *xua)
{
- struct msgb *msg = m3ua_to_msg(xua);
+ struct msgb *msg;
OSMO_ASSERT(asp->cfg.proto == OSMO_SS7_ASP_PROT_M3UA);
+ msg = m3ua_to_msg(xua);
+ xua_msg_free(xua);
if (!msg)
return -1;
+ /* msg becomes owned by osmo_ss7_asp_send here: */
return osmo_ss7_asp_send(asp, msg);
}
/*! \brief Send a given xUA message via a given M3UA Application Server
* \param[in] as Application Server through which to send \ref xua
* \param[in] xua xUA message to be sent
- * \return 0 on success; negative on error */
+ * \return 0 on success; negative on error
+ *
+ * This function takes ownership of xua msg passed to it.
+ */
int m3ua_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua)
{
struct msgb *msg;
@@ -522,6 +530,7 @@
xua_msg_add_u32(xua, M3UA_IEI_ROUTE_CTX, as->cfg.routing_key.context);
msg = m3ua_to_msg(xua);
+ xua_msg_free(xua);
if (!msg) {
LOGPAS(as, DLM3UA, LOGL_ERROR, "Error encoding M3UA Msg\n");
return -1;
@@ -792,10 +801,8 @@
err = m3ua_gen_error_msg(rc, msg);
out:
- if (err) {
+ if (err)
m3ua_tx_xua_asp(asp, err);
- xua_msg_free(err);
- }
xua_msg_free(xua);
@@ -898,7 +905,6 @@
xua = m3ua_encode_duna(rctx, num_rctx, aff_pc, num_aff_pc, info_string);
m3ua_tx_xua_asp(asp, xua);
- xua_msg_free(xua);
}
/*! Transmit SSNM SCON message indicating congestion
@@ -932,7 +938,6 @@
xua_msg_add_data(xua, M3UA_IEI_INFO_STRING, strlen(info_string)+1, (const uint8_t *) info_string);
m3ua_tx_xua_asp(asp, xua);
- xua_msg_free(xua);
}
/*! Transmit SSNM DUPU message indicating user unavailability.
@@ -948,7 +953,6 @@
{
struct xua_msg *xua = m3ua_encode_dupu(rctx, num_rctx, dpc, user, cause, info_str);
m3ua_tx_xua_asp(asp, xua);
- xua_msg_free(xua);
}
/* received SNM message on ASP side */
diff --git a/src/osmo_ss7_hmrt.c b/src/osmo_ss7_hmrt.c
index 5fca2d8..5200bb9 100644
--- a/src/osmo_ss7_hmrt.c
+++ b/src/osmo_ss7_hmrt.c
@@ -86,24 +86,35 @@
return m3ua_xfer_from_data(&data_hdr, msgb_l2(msg), msgb_l2len(msg));
}
-/* delivery given XUA message to given SS7 user */
+/* delivery given XUA message to given SS7 user
+ * Ownership of xua_msg passed is transferred to this function.
+ */
static int deliver_to_mtp_user(const struct osmo_ss7_user *osu,
struct xua_msg *xua)
{
struct osmo_mtp_prim *prim;
+ int rc;
/* Create MTP-TRANSFER.ind and feed to user */
prim = m3ua_to_xfer_ind(xua);
- if (!prim)
- return -1;
+ if (!prim) {
+ rc = -1;
+ goto ret_free;
+ }
prim->u.transfer = xua->mtp;
- return osu->prim_cb(&prim->oph, (void *) osu->priv);
+ rc = osu->prim_cb(&prim->oph, (void *) osu->priv);
+
+ret_free:
+ xua_msg_free(xua);
+ return rc;
}
/* HMDC -> HMDT: Message for distribution; Figure 25/Q.704 */
/* This means it is a message we received from remote/L2, and it is to
- * be routed to a local user part */
+ * be routed to a local user part.
+ * Ownership of xua_msg passed is transferred to this function.
+ */
static int hmdt_message_for_distribution(struct osmo_ss7_instance *inst, struct xua_msg *xua)
{
struct m3ua_data_hdr *mdh;
@@ -120,6 +131,7 @@
default:
LOGP(DLSS7, LOGL_ERROR, "Unknown M3UA XFER Message "
"Type %u\n", xua->hdr.msg_type);
+ xua_msg_free(xua);
return -1;
}
break;
@@ -131,6 +143,7 @@
/* Discard Message */
LOGP(DLSS7, LOGL_ERROR, "Unknown M3UA Message Class %u\n",
xua->hdr.msg_class);
+ xua_msg_free(xua);
return -1;
}
@@ -142,6 +155,7 @@
LOGP(DLSS7, LOGL_NOTICE, "No MTP-User for SI %u\n", service_ind);
/* Discard Message */
/* FIXME: User Part Unavailable HMDT -> HMRT */
+ xua_msg_free(xua);
return -1;
}
}
@@ -207,7 +221,9 @@
/* HMDC->HMRT Msg For Routing; Figure 26/Q.704 */
/* local message was receive d from L4, SRM, SLM, STM or SLTC, or
- * remote message received from L2 and HMDC determined msg for routing */
+ * remote message received from L2 and HMDC determined msg for routing
+ * Ownership of xua_msg passed is transferred to this function.
+ */
static int hmrt_message_for_routing(struct osmo_ss7_instance *inst,
struct xua_msg *xua)
{
@@ -237,6 +253,7 @@
if (osmo_ss7_as_down(as)) {
LOGP(DLSS7, LOGL_ERROR, "Unable to route HMRT message: the AS %s is down\n",
as->cfg.name);
+ xua_msg_free(xua);
return -ENETDOWN;
}
@@ -272,12 +289,14 @@
/* Message Received for inaccesible SP HMRT ->RTPC */
/* Discard Message */
}
+ xua_msg_free(xua);
return -1;
}
/* HMDC: Received Message L2 -> L3; Figure 24/Q.704 */
/* This means a message was received from L2 and we have to decide if it
- * is for the local stack (HMDT) or for routng (HMRT) */
+ * is for the local stack (HMDT) or for routng (HMRT)
+ * Ownership of xua_msg passed is transferred to this function. */
int m3ua_hmdc_rx_from_l2(struct osmo_ss7_instance *inst, struct xua_msg *xua)
{
uint32_t dpc = xua->mtp.dpc;
@@ -314,7 +333,6 @@
* IPv4). So we call m3ua_hmdc_rx_from_l2() just like
* the MTP-TRANSFER had been received from L2. */
rc = m3ua_hmdc_rx_from_l2(inst, xua);
- xua_msg_free(xua);
break;
default:
LOGP(DLSS7, LOGL_ERROR, "Ignoring unknown primitive %u:%u\n",
diff --git a/src/sua.c b/src/sua.c
index e81c471..79e8567 100644
--- a/src/sua.c
+++ b/src/sua.c
@@ -291,13 +291,16 @@
static int sua_tx_xua_asp(struct osmo_ss7_asp *asp, struct xua_msg *xua)
{
- struct msgb *msg = sua_to_msg(xua);
+ struct msgb *msg;
OSMO_ASSERT(asp->cfg.proto == OSMO_SS7_ASP_PROT_SUA);
+ msg = sua_to_msg(xua);
+ xua_msg_free(xua);
if (!msg)
return -1;
+ /* msg becomes owned by osmo_ss7_asp_send here: */
return osmo_ss7_asp_send(asp, msg);
}
@@ -317,6 +320,7 @@
xua_msg_add_u32(xua, SUA_IEI_ROUTE_CTX, as->cfg.routing_key.context);
msg = sua_to_msg(xua);
+ xua_msg_free(xua);
if (!msg) {
LOGPAS(as, DLSUA, LOGL_ERROR, "Error encoding SUA Msg\n");
return -1;
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39396?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I49e718e624da08510a9c3d28bdb360c59f9a65d3
Gerrit-Change-Number: 39396
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>