diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch')
-rw-r--r-- | meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch | 158 |
1 files changed, 158 insertions, 0 deletions
diff --git a/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch b/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch new file mode 100644 index 0000000000..ff745d4774 --- /dev/null +++ b/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch | |||
@@ -0,0 +1,158 @@ | |||
1 | Add ability to specify rcp port numbers | ||
2 | |||
3 | In order to run more than one unfs server on a host system, you must | ||
4 | be able to specify alternate rpc port numbers. | ||
5 | |||
6 | Jason Wessel <jason.wessel@windriver.com> | ||
7 | |||
8 | Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/ | ||
9 | |||
10 | --- | ||
11 | daemon.c | 44 +++++++++++++++++++++++++++++++------------- | ||
12 | mount.c | 4 ++-- | ||
13 | 2 files changed, 33 insertions(+), 15 deletions(-) | ||
14 | |||
15 | --- a/daemon.c | ||
16 | +++ b/daemon.c | ||
17 | @@ -78,6 +78,8 @@ int opt_testconfig = FALSE; | ||
18 | struct in_addr opt_bind_addr; | ||
19 | int opt_readable_executables = FALSE; | ||
20 | char *opt_pid_file = NULL; | ||
21 | +int nfs_prog = NFS3_PROGRAM; | ||
22 | +int mount_prog = MOUNTPROG; | ||
23 | |||
24 | /* Register with portmapper? */ | ||
25 | int opt_portmapper = TRUE; | ||
26 | @@ -206,7 +208,7 @@ static void parse_options(int argc, char | ||
27 | { | ||
28 | |||
29 | int opt = 0; | ||
30 | - char *optstring = "bcC:de:hl:m:n:prstTuwi:"; | ||
31 | + char *optstring = "bcC:de:hl:m:n:prstTuwi:x:y:"; | ||
32 | |||
33 | while (opt != -1) { | ||
34 | opt = getopt(argc, argv, optstring); | ||
35 | @@ -261,8 +263,24 @@ static void parse_options(int argc, char | ||
36 | printf | ||
37 | ("\t-r report unreadable executables as readable\n"); | ||
38 | printf("\t-T test exports file and exit\n"); | ||
39 | + printf("\t-x <port> alternate NFS RPC port\n"); | ||
40 | + printf("\t-y <port> alternate MOUNTD RPC port\n"); | ||
41 | exit(0); | ||
42 | break; | ||
43 | + case 'x': | ||
44 | + nfs_prog = strtol(optarg, NULL, 10); | ||
45 | + if (nfs_prog == 0) { | ||
46 | + fprintf(stderr, "Invalid NFS RPC port\n"); | ||
47 | + exit(1); | ||
48 | + } | ||
49 | + break; | ||
50 | + case 'y': | ||
51 | + mount_prog = strtol(optarg, NULL, 10); | ||
52 | + if (mount_prog == 0) { | ||
53 | + fprintf(stderr, "Invalid MOUNTD RPC port\n"); | ||
54 | + exit(1); | ||
55 | + } | ||
56 | + break; | ||
57 | case 'l': | ||
58 | opt_bind_addr.s_addr = inet_addr(optarg); | ||
59 | if (opt_bind_addr.s_addr == (unsigned) -1) { | ||
60 | @@ -347,12 +365,12 @@ void daemon_exit(int error) | ||
61 | #endif /* WIN32 */ | ||
62 | |||
63 | if (opt_portmapper) { | ||
64 | - svc_unregister(MOUNTPROG, MOUNTVERS1); | ||
65 | - svc_unregister(MOUNTPROG, MOUNTVERS3); | ||
66 | + svc_unregister(mount_prog, MOUNTVERS1); | ||
67 | + svc_unregister(mount_prog, MOUNTVERS3); | ||
68 | } | ||
69 | |||
70 | if (opt_portmapper) { | ||
71 | - svc_unregister(NFS3_PROGRAM, NFS_V3); | ||
72 | + svc_unregister(nfs_prog, NFS_V3); | ||
73 | } | ||
74 | |||
75 | if (error == SIGSEGV) | ||
76 | @@ -657,13 +675,13 @@ static void mountprog_3(struct svc_req * | ||
77 | static void register_nfs_service(SVCXPRT * udptransp, SVCXPRT * tcptransp) | ||
78 | { | ||
79 | if (opt_portmapper) { | ||
80 | - pmap_unset(NFS3_PROGRAM, NFS_V3); | ||
81 | + pmap_unset(nfs_prog, NFS_V3); | ||
82 | } | ||
83 | |||
84 | if (udptransp != NULL) { | ||
85 | /* Register NFS service for UDP */ | ||
86 | if (!svc_register | ||
87 | - (udptransp, NFS3_PROGRAM, NFS_V3, nfs3_program_3, | ||
88 | + (udptransp, nfs_prog, NFS_V3, nfs3_program_3, | ||
89 | opt_portmapper ? IPPROTO_UDP : 0)) { | ||
90 | fprintf(stderr, "%s\n", | ||
91 | "unable to register (NFS3_PROGRAM, NFS_V3, udp)."); | ||
92 | @@ -674,7 +692,7 @@ static void register_nfs_service(SVCXPRT | ||
93 | if (tcptransp != NULL) { | ||
94 | /* Register NFS service for TCP */ | ||
95 | if (!svc_register | ||
96 | - (tcptransp, NFS3_PROGRAM, NFS_V3, nfs3_program_3, | ||
97 | + (tcptransp, nfs_prog, NFS_V3, nfs3_program_3, | ||
98 | opt_portmapper ? IPPROTO_TCP : 0)) { | ||
99 | fprintf(stderr, "%s\n", | ||
100 | "unable to register (NFS3_PROGRAM, NFS_V3, tcp)."); | ||
101 | @@ -686,14 +704,14 @@ static void register_nfs_service(SVCXPRT | ||
102 | static void register_mount_service(SVCXPRT * udptransp, SVCXPRT * tcptransp) | ||
103 | { | ||
104 | if (opt_portmapper) { | ||
105 | - pmap_unset(MOUNTPROG, MOUNTVERS1); | ||
106 | - pmap_unset(MOUNTPROG, MOUNTVERS3); | ||
107 | + pmap_unset(mount_prog, MOUNTVERS1); | ||
108 | + pmap_unset(mount_prog, MOUNTVERS3); | ||
109 | } | ||
110 | |||
111 | if (udptransp != NULL) { | ||
112 | /* Register MOUNT service (v1) for UDP */ | ||
113 | if (!svc_register | ||
114 | - (udptransp, MOUNTPROG, MOUNTVERS1, mountprog_3, | ||
115 | + (udptransp, mount_prog, MOUNTVERS1, mountprog_3, | ||
116 | opt_portmapper ? IPPROTO_UDP : 0)) { | ||
117 | fprintf(stderr, "%s\n", | ||
118 | "unable to register (MOUNTPROG, MOUNTVERS1, udp)."); | ||
119 | @@ -702,7 +720,7 @@ static void register_mount_service(SVCXP | ||
120 | |||
121 | /* Register MOUNT service (v3) for UDP */ | ||
122 | if (!svc_register | ||
123 | - (udptransp, MOUNTPROG, MOUNTVERS3, mountprog_3, | ||
124 | + (udptransp, mount_prog, MOUNTVERS3, mountprog_3, | ||
125 | opt_portmapper ? IPPROTO_UDP : 0)) { | ||
126 | fprintf(stderr, "%s\n", | ||
127 | "unable to register (MOUNTPROG, MOUNTVERS3, udp)."); | ||
128 | @@ -713,7 +731,7 @@ static void register_mount_service(SVCXP | ||
129 | if (tcptransp != NULL) { | ||
130 | /* Register MOUNT service (v1) for TCP */ | ||
131 | if (!svc_register | ||
132 | - (tcptransp, MOUNTPROG, MOUNTVERS1, mountprog_3, | ||
133 | + (tcptransp, mount_prog, MOUNTVERS1, mountprog_3, | ||
134 | opt_portmapper ? IPPROTO_TCP : 0)) { | ||
135 | fprintf(stderr, "%s\n", | ||
136 | "unable to register (MOUNTPROG, MOUNTVERS1, tcp)."); | ||
137 | @@ -722,7 +740,7 @@ static void register_mount_service(SVCXP | ||
138 | |||
139 | /* Register MOUNT service (v3) for TCP */ | ||
140 | if (!svc_register | ||
141 | - (tcptransp, MOUNTPROG, MOUNTVERS3, mountprog_3, | ||
142 | + (tcptransp, mount_prog, MOUNTVERS3, mountprog_3, | ||
143 | opt_portmapper ? IPPROTO_TCP : 0)) { | ||
144 | fprintf(stderr, "%s\n", | ||
145 | "unable to register (MOUNTPROG, MOUNTVERS3, tcp)."); | ||
146 | --- a/mount.c | ||
147 | +++ b/mount.c | ||
148 | @@ -155,8 +155,8 @@ mountres3 *mountproc_mnt_3_svc(dirpath * | ||
149 | /* error out if not version 3 */ | ||
150 | if (rqstp->rq_vers != 3) { | ||
151 | logmsg(LOG_INFO, | ||
152 | - "%s attempted mount with unsupported protocol version", | ||
153 | - inet_ntoa(get_remote(rqstp))); | ||
154 | + "%s attempted mount with unsupported protocol version: %i", | ||
155 | + inet_ntoa(get_remote(rqstp)), rqstp->rq_vers); | ||
156 | result.fhs_status = MNT3ERR_INVAL; | ||
157 | return &result; | ||
158 | } | ||