add -4 and -6 options to use either IPv4 or IPv6

This commit is contained in:
Ryo Nakamura
2024-02-07 14:34:15 +09:00
parent a9c59f744a
commit b2628b54fb
8 changed files with 174 additions and 20 deletions

View File

@@ -27,6 +27,12 @@ static int ssh_set_opts(ssh_session ssh, struct mscp_ssh_opts *opts)
return -1;
}
if (opts->ai_family &&
ssh_options_set(ssh, SSH_OPTIONS_AI_FAMILY, &opts->ai_family) < 0) {
priv_set_errv("failed to set address family");
return -1;
}
if (opts->identity &&
ssh_options_set(ssh, SSH_OPTIONS_IDENTITY, opts->identity) < 0) {
priv_set_errv("failed to set identity");