Change in libosmocore[master]: frame_relay: Discard received messages for DLC not yet active

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
Tue Feb 2 11:37:49 UTC 2021


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

Change subject: frame_relay: Discard received messages for DLC not yet active
......................................................................

frame_relay: Discard received messages for DLC not yet active

If we receive messages for a DLC which has not yet reported as being
available by Q.933 LMI, drop the incoming message.  Otherwise we would
dispatch it to the user, and the user wants to respond - but then
we reject the transmission due to the inactive DLC.

Change-Id: Ia4a045fdf165b526f429f4617e0fdc76036480bd
Related: OS#4999
---
M src/gb/frame_relay.c
1 file changed, 10 insertions(+), 7 deletions(-)

Approvals:
  daniel: Looks good to me, but someone else must approve
  lynxis lazus: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gb/frame_relay.c b/src/gb/frame_relay.c
index a7e1da8..e9436fe 100644
--- a/src/gb/frame_relay.c
+++ b/src/gb/frame_relay.c
@@ -784,19 +784,22 @@
 		goto out;
 	}
 
-	llist_for_each_entry(dlc, &link->dlc_list, list) {
-		if (dlc->dlci == dlci) {
+	dlc = osmo_fr_dlc_by_dlci(link, dlci);
+	if (dlc) {
+		if (dlc->active) {
 			/* dispatch to handler of respective DLC */
 			msg->dst = dlc;
 			return dlc->rx_cb(dlc->cb_data, msg);
+		} else {
+			LOGPFRL(link, LOGL_NOTICE, "DLCI %u not yet active, discarding\n", dlci);
 		}
+	} else {
+		if (link->unknown_dlc_rx_cb)
+			return link->unknown_dlc_rx_cb(link->unknown_dlc_rx_cb_data, msg);
+		else
+			LOGPFRL(link, LOGL_NOTICE, "DLCI %u doesn't exist, discarding\n", dlci);
 	}
 
-	if (link->unknown_dlc_rx_cb)
-		return link->unknown_dlc_rx_cb(link->unknown_dlc_rx_cb_data, msg);
-	else
-		LOGPFRL(link, LOGL_NOTICE, "DLCI %u doesn't exist, discarding\n", dlci);
-
 out:
 	msgb_free(msg);
 

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia4a045fdf165b526f429f4617e0fdc76036480bd
Gerrit-Change-Number: 22576
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210202/48598c81/attachment.htm>


More information about the gerrit-log mailing list