Change in libosmocore[master]: gb: frame_relay: Detect link outage on "last receive seq nr == 0"

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/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Feb 4 18:34:07 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/22708 )

Change subject: gb: frame_relay: Detect link outage on "last receive seq nr == 0"
......................................................................

gb: frame_relay: Detect link outage on "last receive seq nr == 0"

this is a bit of a hack.  Q.933 explicitly forbids either side from ever
sending a sequence number of '0'.  Values start from '1' and are modulo 256,
but '0' is always skipped.  So if the peer is sending us a "last received
sequence number of '0' it means it has not yet received any packets from us,
which in turn can only mean that it has just been restarted.  Let's treat
this as "service affecting condition" and notify upper layers.  This helps
particularly in recovering from rapidly re-starting peers, where the Q.933
nor NS have time to actually detect the connection was lost.

Change-Id: I960a7b17f2550cb49a7b9d72ed87cd271bb64122
Related: OS#4974
---
M src/gb/frame_relay.c
1 file changed, 11 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/gb/frame_relay.c b/src/gb/frame_relay.c
index 679a315..7c75cd0 100644
--- a/src/gb/frame_relay.c
+++ b/src/gb/frame_relay.c
@@ -382,9 +382,19 @@
 	link_int_rx = TLVP_VAL(tp, Q933_IEI_LINK_INT_VERIF);
 	link->last_rx_seq = link_int_rx[0];
 
+	/* this is a bit of a hack.  Q.933 explicitly forbids either side from ever
+	 * sending a sequence number of '0'.  Values start from '1' and are modulo 256,
+	 * but '0' is always skipped.  So if the peer is sending us a "last received
+	 * sequence number of '0' it means it has not yet received any packets from us,
+	 * which in turn can only mean that it has just been restarted.  Let's treat
+	 * this as "service affecting condition" and notify upper layers.  This helps
+	 * particularly in recovering from rapidly re-starting peers, where the Q.933
+	 * nor NS have time to actually detect the connection was lost.  Se OS#4974 */
+	if (link_int_rx[1] == 0) {
+		link_set_failed(link);
 	/* the network checks the receive sequence number received from
 	 * the user equipment against its send sequence counter */
-	if (link_int_rx[1] != link->last_tx_seq) {
+	} else if (link_int_rx[1] != link->last_tx_seq) {
 		check_link_state(link, false);
 		link->err_count++;
 	} else {

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22708
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I960a7b17f2550cb49a7b9d72ed87cd271bb64122
Gerrit-Change-Number: 22708
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210204/7373bd84/attachment.htm>


More information about the gerrit-log mailing list