~ubuntu-branches/ubuntu/raring/autofs5/raring

« back to all changes in this revision

Viewing changes to debian/patches/01UPSTREAM_autofs-5.0.4-dont-fail-on-ipv6-address-adding-host.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Jan Christoph Nordholz
  • Date: 2009-08-28 21:24:14 UTC
  • mfrom: (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090828212414-z9xvmo5kdpm26vxv
Tags: 5.0.4-3
* Fix LSB initscript header to use keywords that
  insserv knows about. Closes: #541841.
* Bump Standards version to 3.8.3.
  * Add README.source.

* Upload sponsored by Petter Reinholdtsen.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 01UPSTREAM_autofs-5.0.4-dont-fail-on-ipv6-address-adding-host.patch
 
3
##
 
4
## DP: Upstream patch on top of 5.0.4.
 
5
 
 
6
@DPATCH@
 
7
autofs-5.0.4 - dont fail on ipv6 address adding host
 
8
 
 
9
From: Ian Kent <raven@themaw.net>
 
10
 
 
11
We don't have IPv6 support enabled in libtirpc yet. When we
 
12
perform name (or address) lookup and we get a mixture of IPv4
 
13
and IPv6 addresses the lack of IPv6 support can cause the
 
14
parse_location() function to fail to add any valid hosts when
 
15
in fact it should.
 
16
---
 
17
 
 
18
 CHANGELOG            |    1 +
 
19
 include/replicated.h |    1 +
 
20
 modules/replicated.c |    9 ++++++++-
 
21
 3 files changed, 10 insertions(+), 1 deletions(-)
 
22
 
 
23
 
 
24
diff --git a/CHANGELOG b/CHANGELOG
 
25
index 89aaa99..7e1012f 100644
 
26
--- a/CHANGELOG
 
27
+++ b/CHANGELOG
 
28
@@ -46,6 +46,7 @@
 
29
 - dont umount existing direct mount on master re-read.
 
30
 - fix incorrect shutdown introduced by library relaod fixes.
 
31
 - improve manual umount recovery.
 
32
+- dont fail on ipv6 address when adding host.
 
33
 
 
34
 4/11/2008 autofs-5.0.4
 
35
 -----------------------
 
36
diff --git a/include/replicated.h b/include/replicated.h
 
37
index e0133ff..fd87c08 100644
 
38
--- a/include/replicated.h
 
39
+++ b/include/replicated.h
 
40
@@ -21,6 +21,7 @@
 
41
 #define PROXIMITY_SUBNET        0x0002
 
42
 #define PROXIMITY_NET           0x0004
 
43
 #define PROXIMITY_OTHER         0x0008
 
44
+#define PROXIMITY_UNSUPPORTED   0x0010
 
45
 
 
46
 #define NFS2_SUPPORTED         0x0010
 
47
 #define NFS3_SUPPORTED         0x0020
 
48
diff --git a/modules/replicated.c b/modules/replicated.c
 
49
index 79845d0..a66de9f 100644
 
50
--- a/modules/replicated.c
 
51
+++ b/modules/replicated.c
 
52
@@ -181,7 +181,7 @@ static unsigned int get_proximity(struct sockaddr *host_addr)
 
53
 
 
54
        case AF_INET6:
 
55
 #ifndef INET6
 
56
-               return PROXIMITY_ERROR;
 
57
+               return PROXIMITY_UNSUPPORTED;
 
58
 #else
 
59
                addr6 = (struct sockaddr_in6 *) host_addr;
 
60
                hst6_addr = (struct in6_addr *) &addr6->sin6_addr;
 
61
@@ -1048,6 +1048,13 @@ static int add_new_host(struct host **list,
 
62
        int addr_len;
 
63
 
 
64
        prx = get_proximity(host_addr->ai_addr);
 
65
+       /*
 
66
+        * If we tried to add an IPv6 address and we don't have IPv6
 
67
+        * support return success in the hope of getting an IPv4
 
68
+        * address later.
 
69
+        */
 
70
+       if (prx == PROXIMITY_UNSUPPORTED)
 
71
+               return 1;
 
72
        if (prx == PROXIMITY_ERROR)
 
73
                return 0;
 
74