aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/gprs_ns.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-13 13:58:08 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-05-13 14:00:59 +0200
commit9aa97fc13725375535c73a0c2f71d3045bb4044c (patch)
treed425641bcc97125d9471751e12ebb4f25782def8 /openbsc/include/openbsc/gprs_ns.h
parenta6fd8f233928e7b8daa1dd29a2d2abfb512c7aec (diff)
[GPRS] NS: Fix segfault when receiving message from unknown NS-VC
In the previous code we used a static fake_nsvc structure in case we needed to send a message to an unknown NSVC for which we don't have a real 'struct nsvc'. However, since we now have a rate_ctr_group hanging off the nsvc, the fake structure didn't have that. So now we keep a nsi->unknown_nsvc around to be used whenever we need a nsvc but don't have a real one. The gprs_ns_vty.c code explicitly does not list that NSVC in 'show ns'
Diffstat (limited to 'openbsc/include/openbsc/gprs_ns.h')
-rw-r--r--openbsc/include/openbsc/gprs_ns.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gprs_ns.h b/openbsc/include/openbsc/gprs_ns.h
index 34b1b62d2..4ccf4c7b9 100644
--- a/openbsc/include/openbsc/gprs_ns.h
+++ b/openbsc/include/openbsc/gprs_ns.h
@@ -125,6 +125,9 @@ struct gprs_ns_inst {
/* linked lists of all NSVC in this instance */
struct llist_head gprs_nsvcs;
+ /* a NSVC object that's needed to deal with packets for unknown NSVC */
+ struct gprs_nsvc *unknown_nsvc;
+
uint16_t timeout[NS_TIMERS_COUNT];
/* which link-layer are we based on? */