gprs_ns2: use gprs_ns2_free_bind() to clean up a bind

gprs_ns2_free_bind() takes care of all required steps to clean up a bind.
The driver->free_bind() operation only cleans up the driver internal state
but not NSVCs and other generic things.
Fixes a crash when free'ing a bind from the vty which has active NSVCs.

Related: OS#5195
Change-Id: I0a2ad22905bcacb929b9b5f5b034af0da3081826
This commit is contained in:
Alexander Couzens 2021-07-06 10:56:55 +02:00
parent 31cf166511
commit 56287d26fe
2 changed files with 7 additions and 3 deletions

View File

@ -423,7 +423,7 @@ DEFUN(cfg_no_ns_bind, cfg_no_ns_bind_cmd,
vty_bind_free(vbind);
bind = gprs_ns2_bind_by_name(vty_nsi, name);
if (bind)
bind->driver->free_bind(bind);
gprs_ns2_free_bind(bind);
return CMD_SUCCESS;
}
@ -678,7 +678,7 @@ DEFUN(cfg_no_ns_bind_listen, cfg_no_ns_bind_listen_cmd,
return CMD_ERR_NOTHING_TODO;
OSMO_ASSERT(bind->ll == GPRS_NS2_LL_UDP);
bind->driver->free_bind(bind);
gprs_ns2_free_bind(bind);
return CMD_SUCCESS;
}
@ -939,7 +939,7 @@ DEFUN(cfg_no_ns_bind_fr, cfg_no_ns_bind_fr_cmd,
return CMD_WARNING;
}
bind->driver->free_bind(bind);
gprs_ns2_free_bind(bind);
return CMD_SUCCESS;
}

View File

@ -83,3 +83,7 @@ OsmoNSdummy(config-ns-nse)# ip-sns-remote 127.0.0.1 22222
OsmoNSdummy(config-ns-nse)# ip-sns-remote 127.0.0.1 22222
Specified SNS endpoint already part of the NSE.
OsmoNSdummy(config-ns-nse)# exit
OsmoNSdummy(config-ns)# no bind abc
OsmoNSdummy(config-ns)# no bind abc77
bind abc77 does not exist!
OsmoNSdummy(config-ns)# exit