Change in libosmocore[master]: gb: frame_relay: Factor-out function to set link as dead

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:28:22 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/22707 )


Change subject: gb: frame_relay: Factor-out function to set link as dead
......................................................................

gb: frame_relay: Factor-out function to set link as dead

Change-Id: I624b6a1175cf7d59173dfff02d6197bb644b9072
---
M src/gb/frame_relay.c
1 file changed, 15 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/07/22707/1

diff --git a/src/gb/frame_relay.c b/src/gb/frame_relay.c
index 96f51cf..679a315 100644
--- a/src/gb/frame_relay.c
+++ b/src/gb/frame_relay.c
@@ -343,6 +343,20 @@
 }
 
 
+static void link_set_failed(struct osmo_fr_link *link)
+{
+	struct osmo_fr_dlc *dlc;
+
+	LOGPFRL(link, LOGL_NOTICE, "Link failed\n");
+	link->state = false;
+	if (link->status_cb)
+		link->status_cb(link, link->cb_data, link->state);
+
+	llist_for_each_entry(dlc, &link->dlc_list, list) {
+		dlc_set_active(dlc, false);
+	}
+}
+
 /* Q.933 */
 static int rx_lmi_q933_status_enq(struct msgb *msg, struct tlv_parsed *tp)
 {
@@ -427,14 +441,7 @@
 		if (!link->state)
 			return;
 
-		LOGPFRL(link, LOGL_NOTICE, "Link failed\n");
-		link->state = false;
-		if (link->status_cb)
-			link->status_cb(link, link->cb_data, link->state);
-
-		llist_for_each_entry(dlc, &link->dlc_list, list) {
-			dlc_set_active(dlc, false);
-		}
+		link_set_failed(link);
 	} else {
 		/* good link */
 		if (link->state)

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I624b6a1175cf7d59173dfff02d6197bb644b9072
Gerrit-Change-Number: 22707
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210204/99d35d88/attachment.htm>


More information about the gerrit-log mailing list