aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-11 12:46:45 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-10-26 09:44:21 +0200
commit0586b0fa47d9bfd4b981e2800b703fc917a8c90a (patch)
tree0c58cf9f158e4ec32d99926e97a0158f00cd8fec /openbsc
parent2484ceb2be16a3e657a01b45de7fcf58c6feb43a (diff)
[vty] First set of fixes for the oml/rsl con dropping
The code had wrong documentation in the VTY, it crashed when OML or RSL was not up yet. These issues are fixed right now.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/bsc_vty.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/openbsc/src/bsc_vty.c b/openbsc/src/bsc_vty.c
index b77d4ddb6..541e3ccf2 100644
--- a/openbsc/src/bsc_vty.c
+++ b/openbsc/src/bsc_vty.c
@@ -2266,8 +2266,9 @@ DEFUN(logging_fltr_imsi,
DEFUN(drop_bts,
drop_bts_cmd,
- "drop bts connection [nr] (oml|rsl)",
- SHOW_STR "Debug/Simulation command to drop ipaccess BTS\n")
+ "drop bts connection <0-65535> (oml|rsl)",
+ "Debug/Simulation command to drop ipaccess BTS\n"
+ "BTS NR\n" "Connection Type\n")
{
struct gsm_network *gsmnet;
struct gsm_bts_trx *trx;
@@ -2297,11 +2298,13 @@ DEFUN(drop_bts,
/* close all connections */
if (strcmp(argv[1], "oml") == 0) {
- close(bts->oml_link->ts->driver.ipaccess.fd.fd);
+ if (bts->oml_link)
+ close(bts->oml_link->ts->driver.ipaccess.fd.fd);
} else if (strcmp(argv[1], "rsl") == 0) {
/* close all rsl connections */
llist_for_each_entry(trx, &bts->trx_list, list) {
- close(trx->rsl_link->ts->driver.ipaccess.fd.fd);
+ if (trx->rsl_link)
+ close(trx->rsl_link->ts->driver.ipaccess.fd.fd);
}
} else {
vty_out(vty, "Argument must be 'oml# or 'rsl'.%s", VTY_NEWLINE);