aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-01-31 18:38:20 +0100
committerlaforge <laforge@osmocom.org>2021-02-02 11:37:48 +0000
commit9d28ce5fd370fcfdb99dc6823df7c5e8d8d923eb (patch)
tree9f3cf7eeab9ffe1a8f4533294c407d0ab0821c71 /src
parent6a9ec42a95d55e6fd46568aa7ec4d2a96a9ef160 (diff)
ns2: Don't start sending NS-RESET until FR DLC is available
There's no point in sending NS-RESET (or any other) messages to the underlying FR layer if the FR DLC has not been marked as available/active yet. Change-Id: Id4e7565ba166ca1d12f8800c643d9f2bc4d66873 Closes: OS#4999
Diffstat (limited to 'src')
-rw-r--r--src/gb/gprs_ns2_fr.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index b5ddf7e9..fc6a5c4d 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -179,6 +179,17 @@ static void free_bind(struct gprs_ns2_vc_bind *bind)
talloc_free(priv);
}
+static void fr_dlci_status_cb(struct osmo_fr_dlc *dlc, void *cb_data, bool active)
+{
+ struct gprs_ns2_vc *nsvc = cb_data;
+
+ if (active) {
+ ns2_vc_fsm_start(nsvc);
+ } else {
+ ns2_vc_force_unconfigured(nsvc);
+ }
+}
+
static struct priv_vc *fr_alloc_vc(struct gprs_ns2_vc_bind *bind,
struct gprs_ns2_vc *nsvc,
uint16_t dlci)
@@ -200,6 +211,7 @@ static struct priv_vc *fr_alloc_vc(struct gprs_ns2_vc_bind *bind,
priv->dlc->cb_data = nsvc;
priv->dlc->rx_cb = fr_dlci_rx_cb;
+ priv->dlc->status_cb = fr_dlci_status_cb;
return priv;
}
@@ -899,8 +911,6 @@ struct gprs_ns2_vc *gprs_ns2_fr_connect(struct gprs_ns2_vc_bind *bind,
nsvc->nsvci = nsvci;
nsvc->nsvci_is_valid = true;
- ns2_vc_fsm_start(nsvc);
-
return nsvc;
err: