laforge submitted this change.

View Change

Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified
client: vty: do not print NULL tls hostname

conn->tls_hostname defaults to NULL and can be cleared via "no tls
hostname". Writing it unconditionally emitted a "tls hostname (null)"
line, producing a config that does not re-parse. Guard it like the
other optional tls fields.

Change-Id: I5b920337409d8c9fa1edb8d47177882cf0a6c4e7
AI-Assisted: yes (Claude)
---
M src/osmo_client_vty.c
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/osmo_client_vty.c b/src/osmo_client_vty.c
index 127e52f..6648417 100644
--- a/src/osmo_client_vty.c
+++ b/src/osmo_client_vty.c
@@ -74,7 +74,8 @@
{
if (conn->tls_on) {
vty_out(vty, "%s enable tls%s", indent, VTY_NEWLINE);
- vty_out(vty, "%s tls hostname %s%s", indent, conn->tls_hostname, VTY_NEWLINE);
+ if (conn->tls_hostname)
+ vty_out(vty, "%s tls hostname %s%s", indent, conn->tls_hostname, VTY_NEWLINE);
vty_out(vty, "%s %stls verify-cert%s", indent,
conn->tls_verify ? "" : "no ", VTY_NEWLINE);
if (conn->tls_capath)

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

Gerrit-MessageType: merged
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: I5b920337409d8c9fa1edb8d47177882cf0a6c4e7
Gerrit-Change-Number: 42840
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>