summaryrefslogtreecommitdiff
path: root/src/ssh.c
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2024-02-07 14:34:15 +0900
committerRyo Nakamura <upa@haeena.net>2024-02-07 15:14:27 +0900
commitb2628b54fb08ff0c91b352c4cfc09923a0896027 (patch)
tree1c77df426e9636c796e4568ac5cd12114b052a9d /src/ssh.c
parenta9c59f744a29f921ab55518a3b2b5b5c7ca6b95d (diff)
add -4 and -6 options to use either IPv4 or IPv6
Diffstat (limited to 'src/ssh.c')
-rw-r--r--src/ssh.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ssh.c b/src/ssh.c
index d9a6a2d..fe6e24f 100644
--- a/src/ssh.c
+++ b/src/ssh.c
@@ -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");