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-04-11 12:46:45 +0200
commit476940f747a03c58058527da20c0d0016f52857e (patch)
tree57f77781f3886a2ed999c66f0d80f786d9f85231 /openbsc
parent8deab8cdee480d52e8c0612557719cee1364b6f5 (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/vty_interface.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c
index d64d49505..3c1f0ba5c 100644
--- a/openbsc/src/vty_interface.c
+++ b/openbsc/src/vty_interface.c
@@ -957,8 +957,8 @@ DEFUN(show_stats,
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")
{
struct gsm_bts_trx *trx;
struct gsm_bts *bts;
@@ -985,11 +985,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);