aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_ns_vty.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-15 23:06:26 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-15 23:06:26 +0200
commit52613a114a12361960d0c0b33db57a5fa981b6e5 (patch)
tree4b31792c87ed7f9916487d892dfbb149e2d2d522 /openbsc/src/gprs/gprs_ns_vty.c
parent55c91e411e6d015d3e94f8335e2bbfc77184230e (diff)
[GPRS] NS: VTY: Don't nsvc_delete() on 'no nse...'
Rather than deleting the NSE from memory, we simply mark it as non-persistent. This makes sure that there are no invalid references (e.g. from gbprox_peer) to the gprs_nsvc structure, but at the same time ensures it will no longer be stored as part of writing the config file.
Diffstat (limited to 'openbsc/src/gprs/gprs_ns_vty.c')
-rw-r--r--openbsc/src/gprs/gprs_ns_vty.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/openbsc/src/gprs/gprs_ns_vty.c b/openbsc/src/gprs/gprs_ns_vty.c
index b4102e44d..a945d865f 100644
--- a/openbsc/src/gprs/gprs_ns_vty.c
+++ b/openbsc/src/gprs/gprs_ns_vty.c
@@ -179,7 +179,7 @@ DEFUN(show_nse, show_nse_cmd, "show ns (nsei|nsvc) <0-65535> [stats]",
return CMD_SUCCESS;
}
-#define NSE_CMD_STR "NS Entity\n" "NS Entity ID (NSEI)\n"
+#define NSE_CMD_STR "Persistent NS Entity\n" "NS Entity ID (NSEI)\n"
DEFUN(cfg_nse_nsvc, cfg_nse_nsvci_cmd,
"nse <0-65535> nsvci <0-65534>",
@@ -273,7 +273,7 @@ DEFUN(cfg_nse_remoterole, cfg_nse_remoterole_cmd,
DEFUN(cfg_no_nse, cfg_no_nse_cmd,
"no nse <0-65535>",
- "Delete NS Entity\n"
+ "Delete Persistent NS Entity\n"
"Delete " NSE_CMD_STR)
{
uint16_t nsei = atoi(argv[0]);
@@ -285,7 +285,13 @@ DEFUN(cfg_no_nse, cfg_no_nse_cmd,
return CMD_WARNING;
}
- nsvc_delete(nsvc);
+ if (!nsvc->persistent) {
+ vty_out(vty, "NSEI %u is not a persistent NSE%s",
+ nsei, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ nsvc->persistent = 0;
return CMD_SUCCESS;
}