]>
Commit | Line | Data |
---|---|---|
3d551623 PG |
1 | diff --git a/CHANGELOG b/CHANGELOG |
2 | index 678e764..aa5d1c1 100644 | |
3 | --- a/CHANGELOG | |
4 | +++ b/CHANGELOG | |
5 | @@ -11,6 +11,7 @@ | |
6 | - fix wait time resolution in alarm and state queue handlers. | |
7 | - fix handling of quoted slash alone. | |
8 | - fix parse confusion between attribute and attribute value. | |
9 | +- fix version passed to get_supported_ver_and_cost. | |
10 | ||
11 | 18/06/2007 autofs-5.0.2 | |
12 | ----------------------- | |
13 | diff --git a/modules/replicated.c b/modules/replicated.c | |
14 | index de1b40c..0764d4a 100644 | |
15 | --- a/modules/replicated.c | |
16 | +++ b/modules/replicated.c | |
17 | @@ -607,12 +607,31 @@ static int get_supported_ver_and_cost(struct host *host, unsigned int version, c | |
18 | ||
19 | parms.pm_prog = NFS_PROGRAM; | |
20 | ||
21 | + /* | |
22 | + * The version passed in is the version as defined in | |
23 | + * include/replicated.h. However, the version we want to send | |
24 | + * off to the rpc calls should match the program version of NFS. | |
25 | + * So, we do the conversion here. | |
26 | + */ | |
27 | if (version & UDP_SELECTED_MASK) { | |
28 | proto = "udp"; | |
29 | - vers = (version << 8); | |
30 | - } else { | |
31 | + version >>= 8; | |
32 | + } else | |
33 | proto = "tcp"; | |
34 | - vers = version; | |
35 | + | |
36 | + switch (version) { | |
37 | + case NFS2_SUPPORTED: | |
38 | + vers = NFS2_VERSION; | |
39 | + break; | |
40 | + case NFS3_SUPPORTED: | |
41 | + vers = NFS3_VERSION; | |
42 | + break; | |
43 | + case NFS4_SUPPORTED: | |
44 | + vers = NFS4_VERSION; | |
45 | + break; | |
46 | + default: | |
47 | + crit(LOGOPT_ANY, "called with invalid version: 0x%x\n", version); | |
48 | + return 0; | |
49 | } | |
50 | ||
51 | rpc_info.proto = getprotobyname(proto); |