ssh-6-option
=================================================================== Gbp-Pq: Name ssh-6-option.diff
This commit is contained in:
parent
aaa5426cd1
commit
0394b96e60
18
main.c
18
main.c
|
@ -117,6 +117,7 @@ int sender_keeps_checksum = 0;
|
|||
# endif
|
||||
static struct sigaction sigact;
|
||||
#endif
|
||||
extern int default_af_hint;
|
||||
|
||||
struct pid_status {
|
||||
pid_t pid;
|
||||
|
@ -454,6 +455,23 @@ static pid_t do_cmd(char *cmd, char *machine, char *user, char **remote_argv, in
|
|||
*t++ = '\0';
|
||||
}
|
||||
|
||||
#ifdef AF_INET
|
||||
if (default_af_hint == AF_INET) {
|
||||
if (strncmp(cmd, "ssh", 3) == 0 || strstr(cmd, "/ssh") != NULL) {
|
||||
/* we're using ssh so we can add a -4 option */
|
||||
args[argc++] = "-4";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef AF_INET6
|
||||
if (default_af_hint == AF_INET6) {
|
||||
if (strncmp(cmd, "ssh", 3) == 0 || strstr(cmd, "/ssh") != NULL) {
|
||||
/* we're using ssh so we can add a -6 option */
|
||||
args[argc++] = "-6";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* check to see if we've already been given '-l user' in
|
||||
* the remote-shell command */
|
||||
for (i = 0; i < argc-1; i++) {
|
||||
|
|
Loading…
Reference in New Issue