File: ssh-6-option.diff

package info (click to toggle)
rsync 3.0.3-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,472 kB
  • ctags: 3,518
  • sloc: ansic: 35,122; sh: 4,882; perl: 1,415; makefile: 267; python: 83
file content (34 lines) | stat: -rw-r--r-- 1,063 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- a/main.c	2008-03-01 21:01:41.000000000 +0100
+++ b/main.c	2008-03-04 18:55:10.933488013 +0100
@@ -82,6 +82,7 @@
 #ifdef ICONV_OPTION
 extern iconv_t ic_send;
 #endif
+extern int default_af_hint;
 
 uid_t our_uid;
 int local_server = 0;
@@ -381,6 +382,23 @@
 			*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++) {