pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-sigtran/+/39650?usp=email )
Change subject: Fix setting traffic-mode 'round-robin' over VTY
......................................................................
Fix setting traffic-mode 'round-robin' over VTY
String in osmo_ss7_as_traffic_mode_vals[] is "round-robin" while string
in VTY command was "roundrobin", so it didn't really match when set over
VTY. This has apparently broken for really long, I couldn't find the
originating commit breaking this.
Change-Id: I61340549c596f1c04bc2269dbc165c327bf72037
---
M src/osmo_ss7_vty.c
M tests/vty/osmo_stp_test.vty
M tests/vty/ss7_asp_test.vty
3 files changed, 9 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/50/39650/1
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 576ad7c..23d4ecc 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -1987,7 +1987,7 @@
DEFUN_USRATTR(as_traf_mode, as_traf_mode_cmd,
OSMO_SCCP_LIB_ATTR_RSTRT_ASP,
- "traffic-mode (broadcast | loadshare | roundrobin | override)",
+ "traffic-mode (broadcast | loadshare | round-robin | override)",
"Specifies traffic mode of operation of the ASP within the AS\n"
"Broadcast to all ASP within AS\n"
"Share Load among all ASP within AS\n"
@@ -1995,8 +1995,12 @@
"Override\n")
{
struct osmo_ss7_as *as = vty->index;
-
- as->cfg.mode = get_string_value(osmo_ss7_as_traffic_mode_vals, argv[0]);
+ int rc = get_string_value(osmo_ss7_as_traffic_mode_vals, argv[0]);
+ if (rc < 0) {
+ vty_out(vty, "%% Wrong traffic-mode '%s'%s", argv[0], VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ as->cfg.mode = rc;
as->cfg.mode_set_by_vty = true;
return CMD_SUCCESS;
}
diff --git a/tests/vty/osmo_stp_test.vty b/tests/vty/osmo_stp_test.vty
index 747c7b7..9ecbc1b 100644
--- a/tests/vty/osmo_stp_test.vty
+++ b/tests/vty/osmo_stp_test.vty
@@ -347,7 +347,7 @@
description .TEXT
asp NAME
no asp NAME
- traffic-mode (broadcast | loadshare | roundrobin | override)
+ traffic-mode (broadcast | loadshare | round-robin | override)
no traffic-mode
recovery-timeout <1-2000>
qos-class <0-7>
diff --git a/tests/vty/ss7_asp_test.vty b/tests/vty/ss7_asp_test.vty
index b565557..7fe6a95 100644
--- a/tests/vty/ss7_asp_test.vty
+++ b/tests/vty/ss7_asp_test.vty
@@ -338,7 +338,7 @@
description .TEXT
asp NAME
no asp NAME
- traffic-mode (broadcast | loadshare | roundrobin | override)
+ traffic-mode (broadcast | loadshare | round-robin | override)
no traffic-mode
recovery-timeout <1-2000>
qos-class <0-255>
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-sigtran/+/39650?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I61340549c596f1c04bc2269dbc165c327bf72037
Gerrit-Change-Number: 39650
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>