pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-cbc/+/28887 )
Change subject: cbsp/sbcap: Fail if trying to Tx on non-connected (connecting) link ......................................................................
cbsp/sbcap: Fail if trying to Tx on non-connected (connecting) link
This way upper layers know right away that the message could not be transmitted to that peer.
Change-Id: I1d2285d18ee064fd78191765e8cb833bf5ee08a4 --- M src/cbsp_link.c M src/sbcap_link.c 2 files changed, 10 insertions(+), 0 deletions(-)
Approvals: Jenkins Builder: Verified dexter: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve
diff --git a/src/cbsp_link.c b/src/cbsp_link.c index 564df3f..2c31455 100644 --- a/src/cbsp_link.c +++ b/src/cbsp_link.c @@ -331,6 +331,11 @@ get_value_string(cbsp_msg_type_names, cbsp->msg_type)); talloc_free(cbsp); return -ENOLINK; + } else if (link->is_client && !osmo_stream_cli_is_connected(link->cli_conn)) { + LOGPCC(link, LOGL_NOTICE, "Cannot transmit %s: reconnecting\n", + get_value_string(cbsp_msg_type_names, cbsp->msg_type)); + talloc_free(cbsp); + return -ENOTCONN; }
LOGPCC(link, LOGL_INFO, "Transmitting %s\n", diff --git a/src/sbcap_link.c b/src/sbcap_link.c index 3f5d792..f8d8a09 100644 --- a/src/sbcap_link.c +++ b/src/sbcap_link.c @@ -398,6 +398,11 @@ sbcap_pdu_get_name(pdu)); rc = -ENOLINK; goto ret_free; + } else if (link->is_client && !osmo_stream_cli_is_connected(link->cli_conn)) { + LOGPSBCAPC(link, LOGL_NOTICE, "Cannot transmit msg %s: reconnecting\n", + sbcap_pdu_get_name(pdu)); + rc = -ENOTCONN; + goto ret_free; }
LOGPSBCAPC(link, LOGL_INFO, "Tx msg %s\n",
1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.