From: Alex Stancu Date: Tue, 11 May 2021 11:44:49 +0000 (+0300) Subject: Bug fix. X-Git-Tag: 1.3.3~6 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fo1-interface.git;a=commitdiff_plain;h=a1eba9f419825263f5fe60a83405d2287f6bd88e Bug fix. Allow SSH_CONNECTIONS=0 as long as TLS_CONNECTIONS > 0 Issue-ID: SIM-69 Change-Id: If923c9068bc8c0d50fbbf0430c0782c119a1e754 Signed-off-by: Alex Stancu --- diff --git a/ntsimulator/ntsim-ng/core/nc_config.c b/ntsimulator/ntsim-ng/core/nc_config.c index fdd1bd9..7700595 100644 --- a/ntsimulator/ntsim-ng/core/nc_config.c +++ b/ntsimulator/ntsim-ng/core/nc_config.c @@ -630,15 +630,17 @@ static int configure_endpoints_connections(sr_session_ctx_t *session) { ssh_connections = framework_environment.settings.ssh_connections; } - if(ssh_connections == 0) { - log_error("ssh_connections must be at least 1\n"); + if(ssh_connections + framework_environment.settings.tls_connections == 0) { + log_error("ssh_connections + tls_connections must be at least 1\n"); return NTS_ERR_FAILED; } - rc = create_ssh_listen_endpoints(netconf_node, ssh_connections); - if(rc != NTS_ERR_OK) { - log_error("could not create %d SSH Listen endpoints on the NETCONF Server\n", ssh_connections); - return NTS_ERR_FAILED; + if (ssh_connections > 0) { + rc = create_ssh_listen_endpoints(netconf_node, ssh_connections); + if(rc != NTS_ERR_OK) { + log_error("could not create %d SSH Listen endpoints on the NETCONF Server\n", ssh_connections); + return NTS_ERR_FAILED; + } } // create the TLS endpoints in ietf-netconf-server