diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-05-13 13:58:08 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-13 14:00:59 +0200 |
commit | dd1c83c52d66c28583e06ba3b930883b488689ea (patch) | |
tree | 6f2ab1ffd9423ed3e81e3db0a31778eff24dcbf5 /openbsc/src/gprs/gprs_ns_vty.c | |
parent | cd2890b0c6589f1c4003df7e9e82fb17ffb2076f (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/src/gprs/gprs_ns_vty.c')
-rw-r--r-- | openbsc/src/gprs/gprs_ns_vty.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_ns_vty.c b/openbsc/src/gprs/gprs_ns_vty.c index 08b0076c..8f0628af 100644 --- a/openbsc/src/gprs/gprs_ns_vty.c +++ b/openbsc/src/gprs/gprs_ns_vty.c @@ -109,6 +109,8 @@ static void dump_ns(struct vty *vty, struct gprs_ns_inst *nsi, int stats) struct gprs_nsvc *nsvc; llist_for_each_entry(nsvc, &nsi->gprs_nsvcs, list) { + if (nsvc == nsi->unknown_nsvc) + continue; vty_out(vty, "NSEI %5u, NS-VC %5u, Remote: %-4s, %5s %9s", nsvc->nsei, nsvc->nsvci, nsvc->remote_end_is_sgsn ? "SGSN" : "BSS", |