Package: distcc / 3.1-6.2

r650_ipv6-zeroconf.patch Patch series | download
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Description: IPv6 patch for Zeroconf and and IPv6 literals in hosts file
Bug: http://code.google.com/p/distcc/issues/detail?id=34
Bug-Debian: http://bugs.debian.org/481951
Bug-Ubuntu: https://bugs.launchpad.net/bugs/593047
Origin: upstream, http://code.google.com/p/distcc/source/detail?r=650

--- a/source/src/zeroconf.c	(revision 649)
+++ b/source/src/zeroconf.c	(revision 650)
@@ -158,9 +158,11 @@
         if (h->resolver)
             /* Not yet fully resolved */
             continue;
+	if (h->address.proto == AVAHI_PROTO_INET6)
+	    snprintf(t, sizeof(t), "[%s]:%u/%i\n", avahi_address_snprint(a, sizeof(a), &h->address), h->port, d->n_slots * h->n_cpus);
+	else
+	    snprintf(t, sizeof(t), "%s:%u/%i\n", avahi_address_snprint(a, sizeof(a), &h->address), h->port, d->n_slots * h->n_cpus);
 
-        snprintf(t, sizeof(t), "%s:%u/%i\n", avahi_address_snprint(a, sizeof(a), &h->address), h->port, d->n_slots * h->n_cpus);
-
         if (dcc_writex(d->fd, t, strlen(t)) != 0) {
             rs_log_crit("write() failed: %s\n", strerror(errno));
             goto finish;
--- a/source/src/hosts.c	(revision 649)
+++ b/source/src/hosts.c	(revision 650)
@@ -322,9 +322,22 @@
     int ret;
     const char *token = token_start;
 
-    if ((ret = dcc_dup_part(&token, &hostdef->hostname, "/: \t\n\r\f,")))
-        return ret;
+    if (token[0] == '[') {
+	/* We have an IPv6 Address */
+	if ((ret = dcc_dup_part(&token, &hostdef->hostname, "/] \t\n\r\f,")))
+	    return ret;
+	if(token[0] != ']') {
+	    rs_log_error("IPv6 Hostname requires closing ']'");
+	    return EXIT_BAD_HOSTSPEC;
+	}
+	token++;
 
+    } else {
+	/* Parse IPv4 address */
+	if ((ret = dcc_dup_part(&token, &hostdef->hostname, "/: \t\n\r\f,")))
+	    return ret;
+    }
+
     if (!hostdef->hostname) {
         rs_log_error("hostname is required in tcp host specification \"%s\"",
                      token_start);
--- a/source/man/distcc.1	(revision 649)
+++ b/source/man/distcc.1	(revision 650)
@@ -480,7 +480,7 @@
   SSH_HOST = [USER]@HOSTID[/LIMIT][:COMMAND][OPTIONS]
   TCP_HOST = HOSTID[:PORT][/LIMIT][OPTIONS]
   OLDSTYLE_TCP_HOST = HOSTID[/LIMIT][:PORT][OPTIONS]
-  HOSTID = HOSTNAME | IPV4
+  HOSTID = HOSTNAME | IPV4 | IPV6
   OPTIONS = ,OPTION[OPTIONS]
   OPTION = lzo | cpp
   GLOBAL_OPTION = --randomize
@@ -496,6 +496,10 @@
 local machine for testing, then give the machine's IP address or real
 hostname.  (This will be slower.)
 .TP
+.B IPV6
+A literal IPv6 address enclosed in square brackets, such as
+.B [::1]
+.TP
 .B IPV4
 A literal IPv4 address, such as 
 .B 10.0.0.1