Change in openbsc[master]: nat: Return error code in queue_for_msc

Pau Espin Pedrol gerrit-no-reply at
Thu May 2 11:19:55 UTC 2019

Pau Espin Pedrol has submitted this change and it was merged. ( )

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

Change-Id: I9f172f9c9ca9db18f6adcf9267db23c73e9d5bc6
M openbsc/src/osmo-bsc_nat/bsc_nat.c
1 file changed, 8 insertions(+), 4 deletions(-)

  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");
-		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");
+		return rc;
+	return 0;
 static void send_reset_ack(struct bsc_connection *bsc)

To view, visit
To unsubscribe, or for help writing mail filters, visit

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>
Gerrit-Reviewer: Harald Welte <laforge at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list