summaryrefslogtreecommitdiff
path: root/connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/connect.c b/connect.c
index a939323d05..c3d1cd3787 100644
--- a/connect.c
+++ b/connect.c
@@ -938,11 +938,30 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,
get_protocol_version_config());
}
- if (variant != VARIANT_SIMPLE) {
- if (flags & CONNECT_IPV4)
+ if (flags & CONNECT_IPV4) {
+ switch (variant) {
+ case VARIANT_AUTO:
+ BUG("VARIANT_AUTO passed to push_ssh_options");
+ case VARIANT_SIMPLE:
+ die("ssh variant 'simple' does not support -4");
+ case VARIANT_SSH:
+ case VARIANT_PLINK:
+ case VARIANT_PUTTY:
+ case VARIANT_TORTOISEPLINK:
argv_array_push(args, "-4");
- else if (flags & CONNECT_IPV6)
+ }
+ } else if (flags & CONNECT_IPV6) {
+ switch (variant) {
+ case VARIANT_AUTO:
+ BUG("VARIANT_AUTO passed to push_ssh_options");
+ case VARIANT_SIMPLE:
+ die("ssh variant 'simple' does not support -6");
+ case VARIANT_SSH:
+ case VARIANT_PLINK:
+ case VARIANT_PUTTY:
+ case VARIANT_TORTOISEPLINK:
argv_array_push(args, "-6");
+ }
}
if (variant == VARIANT_TORTOISEPLINK)