aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2024-02-28 19:40:45 +0100
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2024-02-29 17:20:41 +0700
commitdfa6e681d87c0afe769b7abc80bec8e9f4c65abb (patch)
treea718e1cfde2257fdb1a4dd7a762c332d3d1d9145
parent4d7e20193c264585080b9edc91eb630dd005e396 (diff)
fix regression in sctp-role / transport-role
We saw some fall-out in automatic testing where configs with sctp-role would suddenly save as transport-role. Let's avoid this by keeping sctp-role for users of SCTP. Change-Id: Ic666b62948880445e030c637298d4e369b4c7e8e Fixes: 4d7e201 "VTY: rename 'sctp-role' to 'transport-role', add an alias" Related: SYS#5424, OS#6380
-rw-r--r--src/osmo_ss7_vty.c5
-rw-r--r--tests/vty/ss7_asp_test.vty2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 890dded..9d58fb6 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -1726,7 +1726,10 @@ static void write_one_asp(struct vty *vty, struct osmo_ss7_asp *asp, bool show_d
vty_out(vty, " qos-class %u%s", asp->cfg.qos_class, VTY_NEWLINE);
vty_out(vty, " role %s%s", osmo_str_tolower(get_value_string(osmo_ss7_asp_role_names, asp->cfg.role)),
VTY_NEWLINE);
- vty_out(vty, " transport-role %s%s", asp->cfg.is_server ? "server" : "client", VTY_NEWLINE);
+ if (asp->cfg.trans_proto == IPPROTO_SCTP)
+ vty_out(vty, " sctp-role %s%s", asp->cfg.is_server ? "server" : "client", VTY_NEWLINE);
+ else
+ vty_out(vty, " transport-role %s%s", asp->cfg.is_server ? "server" : "client", VTY_NEWLINE);
if (asp->cfg.sctp_init.num_ostreams_present)
vty_out(vty, " sctp-param init num-ostreams %u%s", asp->cfg.sctp_init.num_ostreams_value, VTY_NEWLINE);
if (asp->cfg.sctp_init.max_instreams_present)
diff --git a/tests/vty/ss7_asp_test.vty b/tests/vty/ss7_asp_test.vty
index b8df809..7168d20 100644
--- a/tests/vty/ss7_asp_test.vty
+++ b/tests/vty/ss7_asp_test.vty
@@ -423,7 +423,7 @@ cs7 instance 0
remote-ip 127.0.0.200
remote-ip 127.0.0.201
role sg
- transport-role server
+ sctp-role server
as my-ass m3ua
asp my-asp
routing-key 0 3.2.1