neels has uploaded this change for review.

View Change

vty: make legacy 'hnbgw'/'sccp cr max...' fatal

Make this deprecated command fatal when in a .cfg file:

hnbgw
sccp cr max-payload-len N

Because we now have:

cs7 instance N
sccp max-optional-data N

from libosmo-sigtran to replace it.

Context: The old command currently has no effect, because we had
implemented the specified fixed 130 byte data limit in libosmo-sigtran.
Recent libosmo-sigtran adds a variable limit configuration.

I considered implementing a shim to redirect the legacy command to the
new implementation, but that would be quite ugly: the old command is
under the 'hnbgw' node and would have to apply to all 'cs7' instances.
But we cannot assume that all 'cs7' are above or below the 'hnbgw' node
in the .cfg file. So I'd have to add global state to remember the legacy
config's value and apply that everywhere else. IMHO this is too much
complexity to support an obsoleted command that has a replacement.

To rule out all confusion that this situation may otherwise create,
abort osmo-hnbgw startup in presence of the legacy VTY command, logging
an error that hints at the new cfg item.

Related: SYS#6423
Change-Id: I71f82efe07af2c32f2aa01084bc8da6ce5c6cd1a
---
M TODO-RELEASE
M src/osmo-hnbgw/hnbgw_vty.c
2 files changed, 45 insertions(+), 4 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/76/32676/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index cf72895..ae5d20f 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -11,3 +11,4 @@
libosmo-sigtran >=1.7.0 Ensure SCCP CR max payload length of 130 bytes is enforced.
Uses osmo_scu_prim_hdr_name_c()
libosmo-mgcp-client > 1.11.0 mgcp_client_pool_empty()
+libosmo-sigtran >1.7.0 Require presence of vty 'cs7 instance'/'sccp max-optional-data' that the deprecated+fatal 'hnbgw'/'sccp cr...' tells the user to use instead.
diff --git a/src/osmo-hnbgw/hnbgw_vty.c b/src/osmo-hnbgw/hnbgw_vty.c
index 216d8cc..93eca41 100644
--- a/src/osmo-hnbgw/hnbgw_vty.c
+++ b/src/osmo-hnbgw/hnbgw_vty.c
@@ -340,10 +340,12 @@
" longer has any effect.\n"
"ignored\n")
{
- vty_out(vty, "%% deprecated, ignored: remove this from your config file: 'sccp cr max-payload-len N'%s",
- VTY_NEWLINE);
- /* Still return success to not break osmo-hnbgw startup for users with old config files. */
- return CMD_SUCCESS;
+ const char *errmsg = "'hnbgw' / 'sccp cr max-payload-len': deprecated, ignored." \
+ " Instead, use 'cs7 instance N' / 'sccp max-optional-data N' (libosmo-sigtran >1.7.0)";
+ vty_out(vty, "%% %s%s", errmsg, VTY_NEWLINE);
+ LOGP(DLGLOBAL, LOGL_ERROR, "VTY cfg: %s\n", errmsg);
+ /* Users should not be mislead into thinking that this config still works. Abort (when reading .cfg file). */
+ return CMD_WARNING;
}

DEFUN(cfg_hnbgw_iucs_remote_addr,

To view, visit change 32676. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I71f82efe07af2c32f2aa01084bc8da6ce5c6cd1a
Gerrit-Change-Number: 32676
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr@sysmocom.de>
Gerrit-MessageType: newchange