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/.
Pau Espin Pedrol gerrit-no-reply at lists.osmocom.orgPau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13840 )
Change subject: nat: Return error code in queue_for_msc
......................................................................
nat: Return error code in queue_for_msc
Might be useful in the future for its callers, since sometimes actions
need to be taken place based on whether enqueuing failed (and msg was
freed).
Change-Id: I9f172f9c9ca9db18f6adcf9267db23c73e9d5bc6
---
M openbsc/src/osmo-bsc_nat/bsc_nat.c
1 file changed, 8 insertions(+), 4 deletions(-)
Approvals:
Jenkins Builder: Verified
Harald Welte: Looks good to me, approved
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index 670b0be..c97483a 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -108,19 +108,23 @@
return NULL;
}
-static void queue_for_msc(struct bsc_msc_connection *con, struct msgb *msg)
+static int queue_for_msc(struct bsc_msc_connection *con, struct msgb *msg)
{
+ int rc;
if (!con) {
LOGP(DLINP, LOGL_ERROR, "No MSC Connection assigned. Check your code.\n");
msgb_free(msg);
- return;
+ return -EINVAL;
}
-
- if (osmo_wqueue_enqueue(&con->write_queue, msg) != 0) {
+ rc = osmo_wqueue_enqueue(&con->write_queue, msg);
+ if (rc != 0) {
LOGP(DLINP, LOGL_ERROR, "Failed to enqueue the write.\n");
msgb_free(msg);
+ return rc;
}
+
+ return 0;
}
static void send_reset_ack(struct bsc_connection *bsc)
--
To view, visit https://gerrit.osmocom.org/13840
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9f172f9c9ca9db18f6adcf9267db23c73e9d5bc6
Gerrit-Change-Number: 13840
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190502/ccd1af77/attachment.htm>