]> Pileus Git - ~andy/linux/blob - net/sunrpc/rpcb_clnt.c
SUNRPC: Allow rpcbind requests to be interrupted by a signal.
[~andy/linux] / net / sunrpc / rpcb_clnt.c
1 /*
2  * In-kernel rpcbind client supporting versions 2, 3, and 4 of the rpcbind
3  * protocol
4  *
5  * Based on RFC 1833: "Binding Protocols for ONC RPC Version 2" and
6  * RFC 3530: "Network File System (NFS) version 4 Protocol"
7  *
8  * Original: Gilles Quillard, Bull Open Source, 2005 <gilles.quillard@bull.net>
9  * Updated: Chuck Lever, Oracle Corporation, 2007 <chuck.lever@oracle.com>
10  *
11  * Descended from net/sunrpc/pmap_clnt.c,
12  *  Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
13  */
14
15 #include <linux/types.h>
16 #include <linux/socket.h>
17 #include <linux/kernel.h>
18 #include <linux/errno.h>
19
20 #include <linux/sunrpc/clnt.h>
21 #include <linux/sunrpc/sched.h>
22
23 #ifdef RPC_DEBUG
24 # define RPCDBG_FACILITY        RPCDBG_BIND
25 #endif
26
27 #define RPCBIND_PROGRAM         (100000u)
28 #define RPCBIND_PORT            (111u)
29
30 enum {
31         RPCBPROC_NULL,
32         RPCBPROC_SET,
33         RPCBPROC_UNSET,
34         RPCBPROC_GETPORT,
35         RPCBPROC_GETADDR = 3,           /* alias for GETPORT */
36         RPCBPROC_DUMP,
37         RPCBPROC_CALLIT,
38         RPCBPROC_BCAST = 5,             /* alias for CALLIT */
39         RPCBPROC_GETTIME,
40         RPCBPROC_UADDR2TADDR,
41         RPCBPROC_TADDR2UADDR,
42         RPCBPROC_GETVERSADDR,
43         RPCBPROC_INDIRECT,
44         RPCBPROC_GETADDRLIST,
45         RPCBPROC_GETSTAT,
46 };
47
48 #define RPCB_HIGHPROC_2         RPCBPROC_CALLIT
49 #define RPCB_HIGHPROC_3         RPCBPROC_TADDR2UADDR
50 #define RPCB_HIGHPROC_4         RPCBPROC_GETSTAT
51
52 /*
53  * r_addr
54  *
55  * Quoting RFC 3530, section 2.2:
56  *
57  * For TCP over IPv4 and for UDP over IPv4, the format of r_addr is the
58  * US-ASCII string:
59  *
60  *      h1.h2.h3.h4.p1.p2
61  *
62  * The prefix, "h1.h2.h3.h4", is the standard textual form for
63  * representing an IPv4 address, which is always four octets long.
64  * Assuming big-endian ordering, h1, h2, h3, and h4, are respectively,
65  * the first through fourth octets each converted to ASCII-decimal.
66  * Assuming big-endian ordering, p1 and p2 are, respectively, the first
67  * and second octets each converted to ASCII-decimal.  For example, if a
68  * host, in big-endian order, has an address of 0x0A010307 and there is
69  * a service listening on, in big endian order, port 0x020F (decimal
70  * 527), then the complete universal address is "10.1.3.7.2.15".
71  *
72  * ...
73  *
74  * For TCP over IPv6 and for UDP over IPv6, the format of r_addr is the
75  * US-ASCII string:
76  *
77  *      x1:x2:x3:x4:x5:x6:x7:x8.p1.p2
78  *
79  * The suffix "p1.p2" is the service port, and is computed the same way
80  * as with universal addresses for TCP and UDP over IPv4.  The prefix,
81  * "x1:x2:x3:x4:x5:x6:x7:x8", is the standard textual form for
82  * representing an IPv6 address as defined in Section 2.2 of [RFC2373].
83  * Additionally, the two alternative forms specified in Section 2.2 of
84  * [RFC2373] are also acceptable.
85  *
86  * XXX: Currently this implementation does not explicitly convert the
87  *      stored address to US-ASCII on non-ASCII systems.
88  */
89 #define RPCB_MAXADDRLEN         (128u)
90
91 /*
92  * r_netid
93  *
94  * Quoting RFC 3530, section 2.2:
95  *
96  * For TCP over IPv4 the value of r_netid is the string "tcp".  For UDP
97  * over IPv4 the value of r_netid is the string "udp".
98  *
99  * ...
100  *
101  * For TCP over IPv6 the value of r_netid is the string "tcp6".  For UDP
102  * over IPv6 the value of r_netid is the string "udp6".
103  */
104 #define RPCB_NETID_UDP  "\165\144\160"          /* "udp" */
105 #define RPCB_NETID_TCP  "\164\143\160"          /* "tcp" */
106 #define RPCB_NETID_UDP6 "\165\144\160\066"      /* "udp6" */
107 #define RPCB_NETID_TCP6 "\164\143\160\066"      /* "tcp6" */
108
109 #define RPCB_MAXNETIDLEN        (4u)
110
111 /*
112  * r_owner
113  *
114  * The "owner" is allowed to unset a service in the rpcbind database.
115  * We always use the following (arbitrary) fixed string.
116  */
117 #define RPCB_OWNER_STRING       "rpcb"
118 #define RPCB_MAXOWNERLEN        sizeof(RPCB_OWNER_STRING)
119
120 static void                     rpcb_getport_done(struct rpc_task *, void *);
121 extern struct rpc_program       rpcb_program;
122
123 struct rpcbind_args {
124         struct rpc_xprt *       r_xprt;
125
126         u32                     r_prog;
127         u32                     r_vers;
128         u32                     r_prot;
129         unsigned short          r_port;
130         char *                  r_netid;
131         char                    r_addr[RPCB_MAXADDRLEN];
132         char *                  r_owner;
133 };
134
135 static struct rpc_procinfo rpcb_procedures2[];
136 static struct rpc_procinfo rpcb_procedures3[];
137
138 static struct rpcb_info {
139         int                     rpc_vers;
140         struct rpc_procinfo *   rpc_proc;
141 } rpcb_next_version[];
142
143 static void rpcb_getport_prepare(struct rpc_task *task, void *calldata)
144 {
145         struct rpcbind_args *map = calldata;
146         struct rpc_xprt *xprt = map->r_xprt;
147         struct rpc_message msg = {
148                 .rpc_proc       = rpcb_next_version[xprt->bind_index].rpc_proc,
149                 .rpc_argp       = map,
150                 .rpc_resp       = &map->r_port,
151         };
152
153         rpc_call_setup(task, &msg, 0);
154 }
155
156 static void rpcb_map_release(void *data)
157 {
158         struct rpcbind_args *map = data;
159
160         xprt_put(map->r_xprt);
161         kfree(map);
162 }
163
164 static const struct rpc_call_ops rpcb_getport_ops = {
165         .rpc_call_prepare       = rpcb_getport_prepare,
166         .rpc_call_done          = rpcb_getport_done,
167         .rpc_release            = rpcb_map_release,
168 };
169
170 static void rpcb_wake_rpcbind_waiters(struct rpc_xprt *xprt, int status)
171 {
172         xprt_clear_binding(xprt);
173         rpc_wake_up_status(&xprt->binding, status);
174 }
175
176 static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
177                                         int proto, int version, int privileged)
178 {
179         struct rpc_create_args args = {
180                 .protocol       = proto,
181                 .address        = srvaddr,
182                 .addrsize       = sizeof(struct sockaddr_in),
183                 .servername     = hostname,
184                 .program        = &rpcb_program,
185                 .version        = version,
186                 .authflavor     = RPC_AUTH_UNIX,
187                 .flags          = (RPC_CLNT_CREATE_NOPING |
188                                    RPC_CLNT_CREATE_INTR),
189         };
190
191         ((struct sockaddr_in *)srvaddr)->sin_port = htons(RPCBIND_PORT);
192         if (!privileged)
193                 args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;
194         return rpc_create(&args);
195 }
196
197 /**
198  * rpcb_register - set or unset a port registration with the local rpcbind svc
199  * @prog: RPC program number to bind
200  * @vers: RPC version number to bind
201  * @prot: transport protocol to use to make this request
202  * @port: port value to register
203  * @okay: result code
204  *
205  * port == 0 means unregister, port != 0 means register.
206  *
207  * This routine supports only rpcbind version 2.
208  */
209 int rpcb_register(u32 prog, u32 vers, int prot, unsigned short port, int *okay)
210 {
211         struct sockaddr_in sin = {
212                 .sin_family             = AF_INET,
213                 .sin_addr.s_addr        = htonl(INADDR_LOOPBACK),
214         };
215         struct rpcbind_args map = {
216                 .r_prog         = prog,
217                 .r_vers         = vers,
218                 .r_prot         = prot,
219                 .r_port         = port,
220         };
221         struct rpc_message msg = {
222                 .rpc_proc       = &rpcb_procedures2[port ?
223                                         RPCBPROC_SET : RPCBPROC_UNSET],
224                 .rpc_argp       = &map,
225                 .rpc_resp       = okay,
226         };
227         struct rpc_clnt *rpcb_clnt;
228         int error = 0;
229
230         dprintk("RPC:       %sregistering (%u, %u, %d, %u) with local "
231                         "rpcbind\n", (port ? "" : "un"),
232                         prog, vers, prot, port);
233
234         rpcb_clnt = rpcb_create("localhost", (struct sockaddr *) &sin,
235                                         IPPROTO_UDP, 2, 1);
236         if (IS_ERR(rpcb_clnt))
237                 return PTR_ERR(rpcb_clnt);
238
239         error = rpc_call_sync(rpcb_clnt, &msg, 0);
240
241         rpc_shutdown_client(rpcb_clnt);
242         if (error < 0)
243                 printk(KERN_WARNING "RPC: failed to contact local rpcbind "
244                                 "server (errno %d).\n", -error);
245         dprintk("RPC:       registration status %d/%d\n", error, *okay);
246
247         return error;
248 }
249
250 #ifdef CONFIG_ROOT_NFS
251 /**
252  * rpcb_getport_external - obtain the port for an RPC service on a given host
253  * @sin: address of remote peer
254  * @prog: RPC program number to bind
255  * @vers: RPC version number to bind
256  * @prot: transport protocol to use to make this request
257  *
258  * Called from outside the RPC client in a synchronous task context.
259  *
260  * For now, this supports only version 2 queries, but is used only by
261  * mount_clnt for NFS_ROOT.
262  */
263 int rpcb_getport_external(struct sockaddr_in *sin, __u32 prog,
264                                 __u32 vers, int prot)
265 {
266         struct rpcbind_args map = {
267                 .r_prog         = prog,
268                 .r_vers         = vers,
269                 .r_prot         = prot,
270                 .r_port         = 0,
271         };
272         struct rpc_message msg = {
273                 .rpc_proc       = &rpcb_procedures2[RPCBPROC_GETPORT],
274                 .rpc_argp       = &map,
275                 .rpc_resp       = &map.r_port,
276         };
277         struct rpc_clnt *rpcb_clnt;
278         char hostname[40];
279         int status;
280
281         dprintk("RPC:       rpcb_getport_external(%u.%u.%u.%u, %u, %u, %d)\n",
282                         NIPQUAD(sin->sin_addr.s_addr), prog, vers, prot);
283
284         sprintf(hostname, "%u.%u.%u.%u", NIPQUAD(sin->sin_addr.s_addr));
285         rpcb_clnt = rpcb_create(hostname, (struct sockaddr *)sin, prot, 2, 0);
286         if (IS_ERR(rpcb_clnt))
287                 return PTR_ERR(rpcb_clnt);
288
289         status = rpc_call_sync(rpcb_clnt, &msg, 0);
290         rpc_shutdown_client(rpcb_clnt);
291
292         if (status >= 0) {
293                 if (map.r_port != 0)
294                         return map.r_port;
295                 status = -EACCES;
296         }
297         return status;
298 }
299 #endif
300
301 /**
302  * rpcb_getport - obtain the port for a given RPC service on a given host
303  * @task: task that is waiting for portmapper request
304  *
305  * This one can be called for an ongoing RPC request, and can be used in
306  * an async (rpciod) context.
307  */
308 void rpcb_getport(struct rpc_task *task)
309 {
310         struct rpc_clnt *clnt = task->tk_client;
311         int bind_version;
312         struct rpc_xprt *xprt = task->tk_xprt;
313         struct rpc_clnt *rpcb_clnt;
314         static struct rpcbind_args *map;
315         struct rpc_task *child;
316         struct sockaddr addr;
317         int status;
318
319         dprintk("RPC: %5u rpcb_getport(%s, %u, %u, %d)\n",
320                         task->tk_pid, clnt->cl_server,
321                         clnt->cl_prog, clnt->cl_vers, xprt->prot);
322
323         /* Autobind on cloned rpc clients is discouraged */
324         BUG_ON(clnt->cl_parent != clnt);
325
326         if (xprt_test_and_set_binding(xprt)) {
327                 status = -EACCES;               /* tell caller to check again */
328                 dprintk("RPC: %5u rpcb_getport waiting for another binder\n",
329                                 task->tk_pid);
330                 goto bailout_nowake;
331         }
332
333         /* Put self on queue before sending rpcbind request, in case
334          * rpcb_getport_done completes before we return from rpc_run_task */
335         rpc_sleep_on(&xprt->binding, task, NULL, NULL);
336
337         /* Someone else may have bound if we slept */
338         if (xprt_bound(xprt)) {
339                 status = 0;
340                 dprintk("RPC: %5u rpcb_getport already bound\n", task->tk_pid);
341                 goto bailout_nofree;
342         }
343
344         if (rpcb_next_version[xprt->bind_index].rpc_proc == NULL) {
345                 xprt->bind_index = 0;
346                 status = -EACCES;       /* tell caller to try again later */
347                 dprintk("RPC: %5u rpcb_getport no more getport versions "
348                                 "available\n", task->tk_pid);
349                 goto bailout_nofree;
350         }
351         bind_version = rpcb_next_version[xprt->bind_index].rpc_vers;
352
353         dprintk("RPC: %5u rpcb_getport trying rpcbind version %u\n",
354                         task->tk_pid, bind_version);
355
356         map = kzalloc(sizeof(struct rpcbind_args), GFP_ATOMIC);
357         if (!map) {
358                 status = -ENOMEM;
359                 dprintk("RPC: %5u rpcb_getport no memory available\n",
360                                 task->tk_pid);
361                 goto bailout_nofree;
362         }
363         map->r_prog = clnt->cl_prog;
364         map->r_vers = clnt->cl_vers;
365         map->r_prot = xprt->prot;
366         map->r_port = 0;
367         map->r_xprt = xprt_get(xprt);
368         map->r_netid = (xprt->prot == IPPROTO_TCP) ? RPCB_NETID_TCP :
369                                                    RPCB_NETID_UDP;
370         memcpy(&map->r_addr, rpc_peeraddr2str(clnt, RPC_DISPLAY_ADDR),
371                         sizeof(map->r_addr));
372         map->r_owner = RPCB_OWNER_STRING;       /* ignored for GETADDR */
373
374         rpc_peeraddr(clnt, (void *)&addr, sizeof(addr));
375         rpcb_clnt = rpcb_create(clnt->cl_server, &addr, xprt->prot, bind_version, 0);
376         if (IS_ERR(rpcb_clnt)) {
377                 status = PTR_ERR(rpcb_clnt);
378                 dprintk("RPC: %5u rpcb_getport rpcb_create failed, error %ld\n",
379                                 task->tk_pid, PTR_ERR(rpcb_clnt));
380                 goto bailout;
381         }
382
383         child = rpc_run_task(rpcb_clnt, RPC_TASK_ASYNC, &rpcb_getport_ops, map);
384         rpc_release_client(rpcb_clnt);
385         if (IS_ERR(child)) {
386                 status = -EIO;
387                 dprintk("RPC: %5u rpcb_getport rpc_run_task failed\n",
388                                 task->tk_pid);
389                 goto bailout_nofree;
390         }
391         rpc_put_task(child);
392
393         task->tk_xprt->stat.bind_count++;
394         return;
395
396 bailout:
397         kfree(map);
398         xprt_put(xprt);
399 bailout_nofree:
400         rpcb_wake_rpcbind_waiters(xprt, status);
401 bailout_nowake:
402         task->tk_status = status;
403 }
404
405 /*
406  * Rpcbind child task calls this callback via tk_exit.
407  */
408 static void rpcb_getport_done(struct rpc_task *child, void *data)
409 {
410         struct rpcbind_args *map = data;
411         struct rpc_xprt *xprt = map->r_xprt;
412         int status = child->tk_status;
413
414         /* rpcbind server doesn't support this rpcbind protocol version */
415         if (status == -EPROTONOSUPPORT)
416                 xprt->bind_index++;
417
418         if (status < 0) {
419                 /* rpcbind server not available on remote host? */
420                 xprt->ops->set_port(xprt, 0);
421         } else if (map->r_port == 0) {
422                 /* Requested RPC service wasn't registered on remote host */
423                 xprt->ops->set_port(xprt, 0);
424                 status = -EACCES;
425         } else {
426                 /* Succeeded */
427                 xprt->ops->set_port(xprt, map->r_port);
428                 xprt_set_bound(xprt);
429                 status = 0;
430         }
431
432         dprintk("RPC: %5u rpcb_getport_done(status %d, port %u)\n",
433                         child->tk_pid, status, map->r_port);
434
435         rpcb_wake_rpcbind_waiters(xprt, status);
436 }
437
438 static int rpcb_encode_mapping(struct rpc_rqst *req, __be32 *p,
439                                struct rpcbind_args *rpcb)
440 {
441         dprintk("RPC:       rpcb_encode_mapping(%u, %u, %d, %u)\n",
442                         rpcb->r_prog, rpcb->r_vers, rpcb->r_prot, rpcb->r_port);
443         *p++ = htonl(rpcb->r_prog);
444         *p++ = htonl(rpcb->r_vers);
445         *p++ = htonl(rpcb->r_prot);
446         *p++ = htonl(rpcb->r_port);
447
448         req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
449         return 0;
450 }
451
452 static int rpcb_decode_getport(struct rpc_rqst *req, __be32 *p,
453                                unsigned short *portp)
454 {
455         *portp = (unsigned short) ntohl(*p++);
456         dprintk("RPC:      rpcb_decode_getport result %u\n",
457                         *portp);
458         return 0;
459 }
460
461 static int rpcb_decode_set(struct rpc_rqst *req, __be32 *p,
462                            unsigned int *boolp)
463 {
464         *boolp = (unsigned int) ntohl(*p++);
465         dprintk("RPC:      rpcb_decode_set result %u\n",
466                         *boolp);
467         return 0;
468 }
469
470 static int rpcb_encode_getaddr(struct rpc_rqst *req, __be32 *p,
471                                struct rpcbind_args *rpcb)
472 {
473         dprintk("RPC:       rpcb_encode_getaddr(%u, %u, %s)\n",
474                         rpcb->r_prog, rpcb->r_vers, rpcb->r_addr);
475         *p++ = htonl(rpcb->r_prog);
476         *p++ = htonl(rpcb->r_vers);
477
478         p = xdr_encode_string(p, rpcb->r_netid);
479         p = xdr_encode_string(p, rpcb->r_addr);
480         p = xdr_encode_string(p, rpcb->r_owner);
481
482         req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
483
484         return 0;
485 }
486
487 static int rpcb_decode_getaddr(struct rpc_rqst *req, __be32 *p,
488                                unsigned short *portp)
489 {
490         char *addr;
491         int addr_len, c, i, f, first, val;
492
493         *portp = 0;
494         addr_len = (unsigned int) ntohl(*p++);
495         if (addr_len > RPCB_MAXADDRLEN)                 /* sanity */
496                 return -EINVAL;
497
498         dprintk("RPC:       rpcb_decode_getaddr returned string: '%s'\n",
499                         (char *) p);
500
501         addr = (char *)p;
502         val = 0;
503         first = 1;
504         f = 1;
505         for (i = addr_len - 1; i > 0; i--) {
506                 c = addr[i];
507                 if (c >= '0' && c <= '9') {
508                         val += (c - '0') * f;
509                         f *= 10;
510                 } else if (c == '.') {
511                         if (first) {
512                                 *portp = val;
513                                 val = first = 0;
514                                 f = 1;
515                         } else {
516                                 *portp |= (val << 8);
517                                 break;
518                         }
519                 }
520         }
521
522         dprintk("RPC:       rpcb_decode_getaddr port=%u\n", *portp);
523         return 0;
524 }
525
526 #define RPCB_program_sz         (1u)
527 #define RPCB_version_sz         (1u)
528 #define RPCB_protocol_sz        (1u)
529 #define RPCB_port_sz            (1u)
530 #define RPCB_boolean_sz         (1u)
531
532 #define RPCB_netid_sz           (1+XDR_QUADLEN(RPCB_MAXNETIDLEN))
533 #define RPCB_addr_sz            (1+XDR_QUADLEN(RPCB_MAXADDRLEN))
534 #define RPCB_ownerstring_sz     (1+XDR_QUADLEN(RPCB_MAXOWNERLEN))
535
536 #define RPCB_mappingargs_sz     RPCB_program_sz+RPCB_version_sz+        \
537                                 RPCB_protocol_sz+RPCB_port_sz
538 #define RPCB_getaddrargs_sz     RPCB_program_sz+RPCB_version_sz+        \
539                                 RPCB_netid_sz+RPCB_addr_sz+             \
540                                 RPCB_ownerstring_sz
541
542 #define RPCB_setres_sz          RPCB_boolean_sz
543 #define RPCB_getportres_sz      RPCB_port_sz
544
545 /*
546  * Note that RFC 1833 does not put any size restrictions on the
547  * address string returned by the remote rpcbind database.
548  */
549 #define RPCB_getaddrres_sz      RPCB_addr_sz
550
551 #define PROC(proc, argtype, restype)                                    \
552         [RPCBPROC_##proc] = {                                           \
553                 .p_proc         = RPCBPROC_##proc,                      \
554                 .p_encode       = (kxdrproc_t) rpcb_encode_##argtype,   \
555                 .p_decode       = (kxdrproc_t) rpcb_decode_##restype,   \
556                 .p_arglen       = RPCB_##argtype##args_sz,              \
557                 .p_replen       = RPCB_##restype##res_sz,               \
558                 .p_statidx      = RPCBPROC_##proc,                      \
559                 .p_timer        = 0,                                    \
560                 .p_name         = #proc,                                \
561         }
562
563 /*
564  * Not all rpcbind procedures described in RFC 1833 are implemented
565  * since the Linux kernel RPC code requires only these.
566  */
567 static struct rpc_procinfo rpcb_procedures2[] = {
568         PROC(SET,               mapping,        set),
569         PROC(UNSET,             mapping,        set),
570         PROC(GETADDR,           mapping,        getport),
571 };
572
573 static struct rpc_procinfo rpcb_procedures3[] = {
574         PROC(SET,               mapping,        set),
575         PROC(UNSET,             mapping,        set),
576         PROC(GETADDR,           getaddr,        getaddr),
577 };
578
579 static struct rpc_procinfo rpcb_procedures4[] = {
580         PROC(SET,               mapping,        set),
581         PROC(UNSET,             mapping,        set),
582         PROC(GETVERSADDR,       getaddr,        getaddr),
583 };
584
585 static struct rpcb_info rpcb_next_version[] = {
586 #ifdef CONFIG_SUNRPC_BIND34
587         { 4, &rpcb_procedures4[RPCBPROC_GETVERSADDR] },
588         { 3, &rpcb_procedures3[RPCBPROC_GETADDR] },
589 #endif
590         { 2, &rpcb_procedures2[RPCBPROC_GETPORT] },
591         { 0, NULL },
592 };
593
594 static struct rpc_version rpcb_version2 = {
595         .number         = 2,
596         .nrprocs        = RPCB_HIGHPROC_2,
597         .procs          = rpcb_procedures2
598 };
599
600 static struct rpc_version rpcb_version3 = {
601         .number         = 3,
602         .nrprocs        = RPCB_HIGHPROC_3,
603         .procs          = rpcb_procedures3
604 };
605
606 static struct rpc_version rpcb_version4 = {
607         .number         = 4,
608         .nrprocs        = RPCB_HIGHPROC_4,
609         .procs          = rpcb_procedures4
610 };
611
612 static struct rpc_version *rpcb_version[] = {
613         NULL,
614         NULL,
615         &rpcb_version2,
616         &rpcb_version3,
617         &rpcb_version4
618 };
619
620 static struct rpc_stat rpcb_stats;
621
622 struct rpc_program rpcb_program = {
623         .name           = "rpcbind",
624         .number         = RPCBIND_PROGRAM,
625         .nrvers         = ARRAY_SIZE(rpcb_version),
626         .version        = rpcb_version,
627         .stats          = &rpcb_stats,
628 };