Currently the field nsvci_is_valid is set to 0 in the NSVC object
returned by gprs_nsvc_create(). This was a semantic change probably
introduced by commit 5e6d679d. As a result, NSVC created via the VTY
have this flag set to 0 causing RESET_ACK messages to be rejected.
This patch changes the default behaviour of gprs_nsvc_create() to
always set this flag. So it must be set to 0 explicitely if needed
which is more intuitive and thus less error prone.
It fixes breaking connections from the Gbproxy to the SGSN.
Ticket: OW#874
Sponsored-by: On-Waves ehf
---
src/gb/gprs_ns.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c
index 55535ad..b500d9a 100644
--- a/src/gb/gprs_ns.c
+++ b/src/gb/gprs_ns.c
@@ -200,6 +200,7 @@ struct gprs_nsvc *gprs_nsvc_create(struct gprs_ns_inst *nsi, uint16_t
nsvci)
nsvc = talloc_zero(nsi, struct gprs_nsvc);
nsvc->nsvci = nsvci;
+ nsvc->nsvci_is_valid = 1;
/* before RESET procedure: BLOCKED and DEAD */
nsvc->state = NSE_S_BLOCKED;
nsvc->nsi = nsi;
@@ -794,7 +795,6 @@ static int gprs_ns_rx_reset(struct gprs_nsvc **nsvc, struct msgb
*msg)
gprs_ns_ll_str(*nsvc));
orig_nsvc = *nsvc;
*nsvc = gprs_nsvc_create((*nsvc)->nsi, nsvci);
- (*nsvc)->nsvci_is_valid = 1;
(*nsvc)->nsei = nsei;
}
}
@@ -1193,6 +1193,7 @@ int gprs_ns_vc_create(struct gprs_ns_inst *nsi, struct msgb *msg,
existing_nsvc = gprs_nsvc_by_nsvci(nsi, nsvci);
if (!existing_nsvc) {
*new_nsvc = gprs_nsvc_create(nsi, 0xffff);
+ (*new_nsvc)->nsvci_is_valid = 0;
log_set_context(GPRS_CTX_NSVC, *new_nsvc);
gprs_ns_ll_copy(*new_nsvc, fallback_nsvc);
LOGP(DNS, LOGL_INFO, "Creating NS-VC for BSS at %s\n",
@@ -1327,6 +1328,7 @@ struct gprs_ns_inst *gprs_ns_instantiate(gprs_ns_cb_t *cb, void
*ctx)
/* Create the dummy NSVC that we use for sending
* messages to non-existant/unknown NS-VC's */
nsi->unknown_nsvc = gprs_nsvc_create(nsi, 0xfffe);
+ nsi->unknown_nsvc->nsvci_is_valid = 0;
llist_del(&nsi->unknown_nsvc->list);
return nsi;
@@ -1527,8 +1529,6 @@ struct gprs_nsvc *gprs_ns_nsip_connect(struct gprs_ns_inst *nsi,
nsvc = gprs_nsvc_create(nsi, nsvci);
nsvc->ip.bts_addr = *dest;
nsvc->nsei = nsei;
- nsvc->nsvci = nsvci;
- nsvc->nsvci_is_valid = 1;
nsvc->remote_end_is_sgsn = 1;
gprs_nsvc_reset(nsvc, NS_CAUSE_OM_INTERVENTION);
--
1.7.9.5
Show replies by date
Sponsored-by: On-Waves ehf
---
debian/changelog | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index d9870ba..e1102e1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libosmocore (0.6.4+git3) UNRELEASED; urgency=low
+
+ * GPRS fix NS connections to a SGSN when configured via VTY
+
+ -- Jacob Erlbeck <jerlbeck(a)sysmocom.de> Thu, 07 Nov 2013 16:07:20 +0100
+
libosmocore (0.6.4+git2) UNRELEASED; urgency=low
* GPRS related changes, some GSM encoding/decoding changes
--
1.7.9.5