Skip to content

IPV6 SSH Callhome connection failing to establish due to host host #460

@Krisscut

Description

@Krisscut

Hi,

Trying to perform an IPV6 callhome connection, it fails when trying to connect on the remote ip to fetch the host from the initial "accept_callhome" that was previously displayed just fine.

The code uses first use

int nc_client_ssh_ch_add_bind_listen(const char *address, uint16_t port);
then
nc_accept_callhome(int timeout, struct ly_ctx *ctx, struct nc_session **session)
) to accept the connection

At this point everything seems fine because the ipv6 is properly displayed here

VRB(NULL, "Accepted a connection on %s:%u from %s:%u.", binds[i].address, binds[i].port, client_address, client_port);

But then later on it seems between the ssh_options_set and the get the host is lost:

ssh_options_set(sess, SSH_OPTIONS_HOST, host);

And we go through that code which default the host to localhost:

host = strdup("localhost");

Log:

configureSSHSessionAuthentication(): Set netconf model path: /ram/yangmodel
configureSSHSessionAuthentication(): Set auth type: PASSWORD enable
configureSSHSessionAuthentication(): Set auth type: PUBLICKEY disable
configureSSHSessionAuthentication(): Set auth type: INTERACTIVE disable
configureSSHSessionAuthentication(): waitCallHome bind to ip: 0:0:0:0:0:0:0:0, port: 4334
configureTLSSessionAuthentication(): waitCallHome bind to ip: 0:0:0:0:0:0:0:0, port: 4335
lnc2_print_clb(): [] nc VBS: Accepted a connection on 0:0:0:0:0:0:0:0:4334 from fd5f:4268:2387:87c1::2:35648.
lnc2_print_clb(): [] nc VBS: set encryption_c_s: aes128-ctr,chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr
lnc2_print_clb(): [] nc VBS: set encryption_s_c: aes128-ctr,chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr
lnc2_print_clb(): [] nc VBS: set macAlgo_c_s: hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-512,hmac-sha2-256-etm@openssh.com
lnc2_print_clb(): [] nc VBS: set macAlgo_s_c: hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-512,hmac-sha2-256-etm@openssh.com
lnc2_print_clb(): [] nc VBS: set compression_c_s NULL
lnc2_print_clb(): [] nc VBS: set compression_s_c NULL
lnc2_print_clb(): [] nc VBS: set key_exchange: ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,curve25519-sha256@libssh.org
lnc2_print_clb(): [] nc VBS: set hostkeys: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256
lnc2_print_clb(): [] nc DBG: nc_sock_connect(localhost, 35648, -1, -1)
lnc2_print_clb(): [] nc VBS: Trying to connect via IPv4 to 127.0.0.1:35648.
lnc2_print_clb(): [] nc VBS: getsockopt() error (Connection refused).
lnc2_print_clb(): [] nc ERR: Unable to connect to localhost:35648 (Connection refused).

Metadata

Metadata

Assignees

No one assigned

    Labels

    is:bugBug description.status:invalidIssue is not reproducible.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions