neels submitted this change.
pfcp_endpoint: fix final PFCP retrans resp_cb
After the final retransmission of a sent request, still keep the message
in the queue for its expiry period, so that a later response is matched
to the request.
The osmo_pfcp_msg.resp_cb() depends on the sent message to remain in the
queue until it times out. That was not the case in an earlier stage of
libosmo-pfcp development.
I noticed this during ttcn3 testing, where osmo-hnbgw continuously
resends PFCP Association Setup Requests, and fails to associate if ttcn3
happens to respond to the final retransmission of a request.
Related: SYS#5599
Change-Id: Iaca396891921f7057015ce6e1e4528b955757809
---
M src/libosmo-pfcp/pfcp_endpoint.c
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/libosmo-pfcp/pfcp_endpoint.c b/src/libosmo-pfcp/pfcp_endpoint.c
index 0ee3a9a..68d0a21 100644
--- a/src/libosmo-pfcp/pfcp_endpoint.c
+++ b/src/libosmo-pfcp/pfcp_endpoint.c
@@ -181,18 +181,19 @@
struct osmo_pfcp_msg *m = qe->m;
int rc;
- /* re-transmit */
- if (qe->n1_remaining)
- qe->n1_remaining--;
- OSMO_LOG_PFCP_MSG(m, LOGL_INFO, "re-sending (%u attempts remaining)\n", qe->n1_remaining);
-
- rc = osmo_pfcp_endpoint_tx_data_no_logging(endpoint, m);
- /* If encoding failed, it cannot ever succeed. Drop the queue entry. */
- if (rc)
- return false;
/* if no more attempts remaining, drop from queue */
if (!qe->n1_remaining)
return false;
+
+ /* re-transmit */
+ qe->n1_remaining--;
+ OSMO_LOG_PFCP_MSG(m, LOGL_INFO, "re-sending (%u attempts remaining after this)\n", qe->n1_remaining);
+
+ rc = osmo_pfcp_endpoint_tx_data_no_logging(endpoint, m);
+ /* If encoding failed, it cannot ever succeed. Drop the queue entry. (Error logging already taken care of in
+ * osmo_pfcp_endpoint_tx_data_no_logging().) */
+ if (rc)
+ return false;
/* re-schedule timer, keep in queue */
osmo_timer_schedule(&qe->t1, t1_ms/1000, (t1_ms % 1000) * 1000);
return true;
To view, visit change 28812. To unsubscribe, or for help writing mail filters, visit settings.