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