tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: xdrproc_t prototype



On Wed, 24 Aug 2011, Iain Hibbert wrote:

> On Wed, 24 Aug 2011, Martin Husemann wrote:
>
> > On Wed, Aug 24, 2011 at 10:21:31AM -0400, Mouse wrote:
> > > It certainly can work in the sense of "the code runs and does what is
> > > intended".  However, David is right in that it will be depending on
> > > something the language does not promise and thus is liable to break on
> > > some of our ports - or on the next compiler release for this one
> > > (whichever "this one" is).
> >
> > Yeah, "can not work" was overworded. But:
> > We have actually seen it break, IIRC, in similar context (on amd64?)
>
> Ok I will investigate non-vararg prototype for xdrproc_t

seems its fine to use

- *
- * XXX can't actually prototype it, because some take three args!!!
 */
-typedef        bool_t (*xdrproc_t)(/* XDR *, void *, u_int */);
+typedef        bool_t (*xdrproc_t)(XDR *, const void *);

instead of the vararg

as to the 'three args' versions (eg xdr_string) they all seem to have a
'two arg' wrapper anyway (eg xdr_wrapstring) so I'm not sure if that
comment is any longer pertinent..

iain
(updated patch attached)
Index: include/rpc/xdr.h
===================================================================
RCS file: /cvsroot/src/include/rpc/xdr.h,v
retrieving revision 1.26
diff -u -p -r1.26 xdr.h
--- include/rpc/xdr.h   4 Jul 2011 07:54:38 -0000       1.26
+++ include/rpc/xdr.h   25 Aug 2011 05:32:25 -0000
@@ -130,10 +130,8 @@ typedef struct __rpc_xdr {
  * The opaque pointer generally points to a structure of the data type
  * to be decoded.  If this pointer is 0, then the type routines should
  * allocate dynamic storage of the appropriate size and return it.
- *
- * XXX can't actually prototype it, because some take three args!!!
  */
-typedef        bool_t (*xdrproc_t)(/* XDR *, void *, u_int */);
+typedef        bool_t (*xdrproc_t)(XDR *, const void *); 
 
 /*
  * Operations defined on a XDR handle
Index: include/rpc/clnt.h
===================================================================
RCS file: /cvsroot/src/include/rpc/clnt.h,v
retrieving revision 1.20
diff -u -p -r1.20 clnt.h
--- include/rpc/clnt.h  3 Dec 2005 15:16:19 -0000       1.20
+++ include/rpc/clnt.h  25 Aug 2011 05:32:36 -0000
@@ -206,11 +206,13 @@ struct rpc_timers {
  *     struct timeval timeout;
  */
 #define        CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs)             
\
-       ((*(rh)->cl_ops->cl_call)(rh, proc, xargs,                      \
-       (const char *)(const void *)(argsp), xres, (caddr_t)(void *)resp, secs))
+       ((*(rh)->cl_ops->cl_call)(rh, proc, (xdrproc_t)xargs,           \
+       (const char *)(const void *)(argsp), (xdrproc_t)xres,           \
+       (caddr_t)(void *)resp, secs))
 #define        clnt_call(rh, proc, xargs, argsp, xres, resp, secs)             
\
-       ((*(rh)->cl_ops->cl_call)(rh, proc, xargs,                      \
-       (const char *)(const void *)(argsp), xres, (caddr_t)(void *)resp, secs))
+       ((*(rh)->cl_ops->cl_call)(rh, proc, (xdrproc_t)xargs,           \
+       (const char *)(const void *)(argsp), (xdrproc_t)xres,           \
+       (caddr_t)(void *)resp, secs))
 
 /*
  * void
Index: include/rpc/svc.h
===================================================================
RCS file: /cvsroot/src/include/rpc/svc.h,v
retrieving revision 1.23
diff -u -p -r1.23 svc.h
--- include/rpc/svc.h   26 Dec 2005 19:01:47 -0000      1.23
+++ include/rpc/svc.h   25 Aug 2011 05:32:41 -0000
@@ -163,9 +163,9 @@ struct svc_req {
        (*(xprt)->xp_ops->xp_stat)(xprt)
 
 #define SVC_GETARGS(xprt, xargs, argsp)                        \
-       (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
+       (*(xprt)->xp_ops->xp_getargs)((xprt), ((xdrproc_t)(xargs)), (argsp))
 #define svc_getargs(xprt, xargs, argsp)                        \
-       (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
+       (*(xprt)->xp_ops->xp_getargs)((xprt), ((xdrproc_t)(xargs)), (argsp))
 
 #define SVC_REPLY(xprt, msg)                           \
        (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
@@ -173,9 +173,9 @@ struct svc_req {
        (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
 
 #define SVC_FREEARGS(xprt, xargs, argsp)               \
-       (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
+       (*(xprt)->xp_ops->xp_freeargs)((xprt), ((xdrproc_t)(xargs)), (argsp))
 #define svc_freeargs(xprt, xargs, argsp)               \
-       (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
+       (*(xprt)->xp_ops->xp_freeargs)((xprt), ((xdrproc_t)(xargs)), (argsp))
 
 #define SVC_DESTROY(xprt)                              \
        (*(xprt)->xp_ops->xp_destroy)(xprt)
Index: lib/libquota/getnfsquota.c
===================================================================
RCS file: /cvsroot/src/lib/libquota/getnfsquota.c,v
retrieving revision 1.1
diff -u -p -r1.1 getnfsquota.c
--- lib/libquota/getnfsquota.c  24 Mar 2011 17:05:43 -0000      1.1
+++ lib/libquota/getnfsquota.c  25 Aug 2011 05:32:46 -0000
@@ -151,15 +151,15 @@ getnfsquota(const char *mp, struct ufs_q
        ext_gq_args.gqa_id = id;
        ext_gq_args.gqa_type = rpcqtype;
        ret = callaurpc(host, RQUOTAPROG, EXT_RQUOTAVERS,
-           RQUOTAPROC_GETQUOTA, xdr_ext_getquota_args, &ext_gq_args,
-           xdr_getquota_rslt, &gq_rslt);
+           RQUOTAPROC_GETQUOTA, (xdrproc_t)xdr_ext_getquota_args,
+           &ext_gq_args, (xdrproc_t)xdr_getquota_rslt, &gq_rslt);
        if (ret == RPC_PROGVERSMISMATCH && rpcqtype == RQUOTA_USRQUOTA) {
                /* try RQUOTAVERS */
                gq_args.gqa_pathp = path;
                gq_args.gqa_uid = id;
                ret = callaurpc(host, RQUOTAPROG, RQUOTAVERS,
-                   RQUOTAPROC_GETQUOTA, xdr_getquota_args, &gq_args,
-                   xdr_getquota_rslt, &gq_rslt);
+                   RQUOTAPROC_GETQUOTA, (xdrproc_t)xdr_getquota_args,
+                   &gq_args, (xdrproc_t)xdr_getquota_rslt, &gq_rslt);
        }
        free(host);
 
Index: lib/librpcsvc/rnusers.x
===================================================================
RCS file: /cvsroot/src/lib/librpcsvc/rnusers.x,v
retrieving revision 1.13
diff -u -p -r1.13 rnusers.x
--- lib/librpcsvc/rnusers.x     11 May 2006 17:11:57 -0000      1.13
+++ lib/librpcsvc/rnusers.x     25 Aug 2011 05:32:46 -0000
@@ -146,7 +146,7 @@
 %{
 %
 %      if (!xdr_reference(xdrs, (char **) objpp, (u_int)sizeof(struct ru_utmp),
-%                         xdr_utmp))
+%                         (xdrproc_t)xdr_utmp))
 %              return (FALSE);
 %      return (TRUE);
 %}
@@ -159,7 +159,7 @@
 %
 %      if (!xdr_array(xdrs, (char **)(void *)&objp->uta_arr,
 %                     (u_int *)&objp->uta_cnt, MAXUSERS,
-%                     (u_int)sizeof(struct utmp *), xdr_utmpptr))
+%                     (u_int)sizeof(struct utmp *), (xdrproc_t)xdr_utmpptr))
 %              return (FALSE);
 %      return (TRUE);
 %}
@@ -184,7 +184,8 @@
 %{
 %
 %      if (!xdr_reference(xdrs, (char **) objpp,
-%                         (u_int)sizeof(struct utmpidle), xdr_utmpidle))
+%                         (u_int)sizeof(struct utmpidle),
+%                         (xdrproc_t)xdr_utmpidle))
 %              return (FALSE);
 %      return (TRUE);
 %}
@@ -197,7 +198,8 @@
 %
 %      if (!xdr_array(xdrs, (char **)(void *)&objp->uia_arr,
 %                     (u_int *)&objp->uia_cnt, MAXUSERS,
-%                     (u_int)sizeof(struct utmpidle *), xdr_utmpidleptr))
+%                     (u_int)sizeof(struct utmpidle *),
+%                     (xdrproc_t)xdr_utmpidleptr))
 %              return (FALSE);
 %      return (TRUE);
 %}
Index: libexec/rpc.rquotad/rquotad.c
===================================================================
RCS file: /cvsroot/src/libexec/rpc.rquotad/rquotad.c,v
retrieving revision 1.27
diff -u -p -r1.27 rquotad.c
--- libexec/rpc.rquotad/rquotad.c       24 Mar 2011 17:05:43 -0000      1.27
+++ libexec/rpc.rquotad/rquotad.c       25 Aug 2011 05:32:50 -0000
@@ -127,7 +127,7 @@ rquota_service(struct svc_req *request, 
 {
        switch (request->rq_proc) {
        case NULLPROC:
-               (void)svc_sendreply(transp, xdr_void, (char *)NULL);
+               (void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
                break;
 
        case RQUOTAPROC_GETQUOTA:
@@ -148,7 +148,7 @@ ext_rquota_service(struct svc_req *reque
 {
        switch (request->rq_proc) {
        case NULLPROC:
-               (void)svc_sendreply(transp, xdr_void, (char *)NULL);
+               (void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
                break;
 
        case RQUOTAPROC_GETQUOTA:
@@ -237,7 +237,7 @@ sendquota(struct svc_req *request, int v
                    qe[QUOTA_LIMIT_FILE].ufsqe_time - timev.tv_sec;
        }
 out:
-       if (!svc_sendreply(transp, xdr_getquota_rslt, (char *)&getq_rslt))
+       if (!svc_sendreply(transp, (xdrproc_t)xdr_getquota_rslt, (char 
*)&getq_rslt))
                svcerr_systemerr(transp);
        if (!svc_freeargs(transp, xdr_getquota_args, (caddr_t)&getq_args)) {
                syslog(LOG_ERR, "unable to free arguments");
Index: libexec/rpc.rstatd/rstat_proc.c
===================================================================
RCS file: /cvsroot/src/libexec/rpc.rstatd/rstat_proc.c,v
retrieving revision 1.44
diff -u -p -r1.44 rstat_proc.c
--- libexec/rpc.rstatd/rstat_proc.c     16 Mar 2009 00:51:06 -0000      1.44
+++ libexec/rpc.rstatd/rstat_proc.c     25 Aug 2011 05:33:00 -0000
@@ -378,7 +378,7 @@ rstat_service(struct svc_req *rqstp, SVC
 
        switch (rqstp->rq_proc) {
        case NULLPROC:
-               (void)svc_sendreply(transp, xdr_void, (char *)NULL);
+               (void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
                goto leave;
 
        case RSTATPROC_STATS:
Index: libexec/rpc.rusersd/rusers_proc.c
===================================================================
RCS file: /cvsroot/src/libexec/rpc.rusersd/rusers_proc.c,v
retrieving revision 1.26
diff -u -p -r1.26 rusers_proc.c
--- libexec/rpc.rusersd/rusers_proc.c   16 Mar 2009 00:56:16 -0000      1.26
+++ libexec/rpc.rusersd/rusers_proc.c   25 Aug 2011 05:33:00 -0000
@@ -360,7 +360,7 @@ rusers_service(struct svc_req *rqstp, SV
 
        switch (rqstp->rq_proc) {
        case NULLPROC:
-               (void)svc_sendreply(transp, xdr_void, NULL);
+               (void)svc_sendreply(transp, (xdrproc_t)xdr_void, NULL);
                goto leave;
 
        case RUSERSPROC_NUM:
Index: libexec/rpc.rwalld/rwalld.c
===================================================================
RCS file: /cvsroot/src/libexec/rpc.rwalld/rwalld.c,v
retrieving revision 1.20
diff -u -p -r1.20 rwalld.c
--- libexec/rpc.rwalld/rwalld.c 9 May 2006 20:18:07 -0000       1.20
+++ libexec/rpc.rwalld/rwalld.c 25 Aug 2011 05:33:02 -0000
@@ -159,7 +159,7 @@ wallprog_1(struct svc_req *rqstp, SVCXPR
 
        switch (rqstp->rq_proc) {
        case NULLPROC:
-               (void)svc_sendreply(transp, xdr_void, (char *)NULL);
+               (void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
                goto leave;
 
        case WALLPROC_WALL:
Index: libexec/rpc.sprayd/sprayd.c
===================================================================
RCS file: /cvsroot/src/libexec/rpc.sprayd/sprayd.c,v
retrieving revision 1.15
diff -u -p -r1.15 sprayd.c
--- libexec/rpc.sprayd/sprayd.c 21 Oct 2009 01:07:46 -0000      1.15
+++ libexec/rpc.sprayd/sprayd.c 25 Aug 2011 05:33:02 -0000
@@ -133,7 +133,7 @@ spray_service(struct svc_req *rqstp, SVC
                /*FALLTHROUGH*/
 
        case NULLPROC:
-               (void)svc_sendreply(transp, xdr_void, (char *)NULL);
+               (void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
                return;
 
        case SPRAYPROC_SPRAY:
@@ -152,7 +152,7 @@ spray_service(struct svc_req *rqstp, SVC
                return;
        }
 
-       if (!svc_sendreply(transp, xdr_spraycumul, (caddr_t)&scum)) {
+       if (!svc_sendreply(transp, (xdrproc_t)xdr_spraycumul, (caddr_t)&scum)) {
                svcerr_systemerr(transp);
                syslog(LOG_WARNING, "bad svc_sendreply");
        }
Index: tests/fs/nfs/nfsservice/mountd.c
===================================================================
RCS file: /cvsroot/src/tests/fs/nfs/nfsservice/mountd.c,v
retrieving revision 1.5
diff -u -p -r1.5 mountd.c
--- tests/fs/nfs/nfsservice/mountd.c    31 Dec 2010 17:59:24 -0000      1.5
+++ tests/fs/nfs/nfsservice/mountd.c    25 Aug 2011 05:33:55 -0000
@@ -536,7 +536,7 @@ mntsrv(rqstp, transp)
        ret = 0;
        switch (rqstp->rq_proc) {
        case NULLPROC:
-               if (!svc_sendreply(transp, xdr_void, NULL))
+               if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
                        syslog(LOG_ERR, "Can't send reply");
                return;
        case MOUNTPROC_MNT:
@@ -567,7 +567,7 @@ mntsrv(rqstp, transp)
                        if (debug)
                                (void)fprintf(stderr, "-> stat failed on %s\n",
                                    dpath);
-                       if (!svc_sendreply(transp, xdr_long, (caddr_t) &bad))
+                       if (!svc_sendreply(transp, (xdrproc_t)xdr_long, 
(caddr_t) &bad))
                                syslog(LOG_ERR, "Can't send reply");
                        return;
                }
@@ -603,7 +603,7 @@ mntsrv(rqstp, transp)
                        if (rump_sys_getfh(dpath, &fhr.fhr_fh, &fh_size) < 0) {
                                bad = error;
                                //syslog(LOG_ERR, "Can't get fh for %s %d %d", 
dpath, error, fh_size);
-                               if (!svc_sendreply(transp, xdr_long,
+                               if (!svc_sendreply(transp, (xdrproc_t)xdr_long,
                                    (char *)&bad))
                                        syslog(LOG_ERR, "Can't send reply");
                                goto out;
@@ -611,13 +611,13 @@ mntsrv(rqstp, transp)
                        if ((fhr.fhr_vers == 1 && fh_size > NFSX_V2FH) ||
                            fh_size > NFSX_V3FHMAX) {
                                bad = EINVAL; /* XXX */
-                               if (!svc_sendreply(transp, xdr_long,
+                               if (!svc_sendreply(transp, (xdrproc_t)xdr_long,
                                    (char *)&bad))
                                        syslog(LOG_ERR, "Can't send reply");
                                goto out;
                        }
                        fhr.fhr_fhsize = fh_size;
-                       if (!svc_sendreply(transp, xdr_fhs, (char *) &fhr))
+                       if (!svc_sendreply(transp, (xdrproc_t)xdr_fhs, (char *) 
&fhr))
                                syslog(LOG_ERR, "Can't send reply");
                        if (!lookup_failed)
                                add_mlist(host, dpath, hostset);
@@ -626,14 +626,14 @@ mntsrv(rqstp, transp)
                        if (debug)
                                (void)fprintf(stderr, "Mount successful.\n");
                } else {
-                       if (!svc_sendreply(transp, xdr_long, (caddr_t) &bad))
+                       if (!svc_sendreply(transp, (xdrproc_t)xdr_long, 
(caddr_t) &bad))
                                syslog(LOG_ERR, "Can't send reply");
                }
 out:
                (void)sigprocmask(SIG_UNBLOCK, &sighup_mask, NULL);
                return;
        case MOUNTPROC_DUMP:
-               if (!svc_sendreply(transp, xdr_mlist, NULL))
+               if (!svc_sendreply(transp, (xdrproc_t)xdr_mlist, NULL))
                        syslog(LOG_ERR, "Can't send reply");
                return;
        case MOUNTPROC_UMNT:
@@ -648,7 +648,7 @@ out:
                        svcerr_weakauth(transp);
                        return;
                }
-               if (!svc_sendreply(transp, xdr_void, NULL))
+               if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
                        syslog(LOG_ERR, "Can't send reply");
                return;
        case MOUNTPROC_UMNTALL:
@@ -659,12 +659,12 @@ out:
                        svcerr_weakauth(transp);
                        return;
                }
-               if (!svc_sendreply(transp, xdr_void, NULL))
+               if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
                        syslog(LOG_ERR, "Can't send reply");
                return;
        case MOUNTPROC_EXPORT:
        case MOUNTPROC_EXPORTALL:
-               if (!svc_sendreply(transp, xdr_explist, NULL))
+               if (!svc_sendreply(transp, (xdrproc_t)xdr_explist, NULL))
                        syslog(LOG_ERR, "Can't send reply");
                return;
 
Index: usr.bin/rup/rup.c
===================================================================
RCS file: /cvsroot/src/usr.bin/rup/rup.c,v
retrieving revision 1.27
diff -u -p -r1.27 rup.c
--- usr.bin/rup/rup.c   15 Dec 2007 19:44:53 -0000      1.27
+++ usr.bin/rup/rup.c   25 Aug 2011 05:33:55 -0000
@@ -323,7 +323,7 @@ allhosts(void)
        }
 
        clnt_stat = rpc_broadcast(RSTATPROG, RSTATVERS_TIME, RSTATPROC_STATS,
-           xdr_void, NULL, xdr_statstime, (caddr_t)(void *)&host_stat,
+           (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_statstime, (caddr_t)(void 
*)&host_stat,
            (resultproc_t)rstat_reply, "udp");
        if (clnt_stat != RPC_SUCCESS && clnt_stat != RPC_TIMEDOUT)
                errx(1, "%s", clnt_sperrno(clnt_stat));
Index: usr.bin/rusers/rusers.c
===================================================================
RCS file: /cvsroot/src/usr.bin/rusers/rusers.c,v
retrieving revision 1.23
diff -u -p -r1.23 rusers.c
--- usr.bin/rusers/rusers.c     11 May 2006 01:25:23 -0000      1.23
+++ usr.bin/rusers/rusers.c     25 Aug 2011 05:33:56 -0000
@@ -262,8 +262,9 @@ allhosts(void)
 
        memset((char *)&up, 0, sizeof(up));
        clnt_stat = rpc_broadcast(RUSERSPROG, RUSERSVERS_IDLE,
-           RUSERSPROC_NAMES, xdr_void, NULL, xdr_utmpidlearr,
-           (char *)&up, (resultproc_t)rusers_reply, "udp");
+           RUSERSPROC_NAMES, (xdrproc_t)xdr_void, NULL,
+           (xdrproc_t)xdr_utmpidlearr, (char *)&up,
+           (resultproc_t)rusers_reply, "udp");
        if (clnt_stat != RPC_SUCCESS && clnt_stat != RPC_TIMEDOUT)
                errx(1, "%s", clnt_sperrno(clnt_stat));
 }
Index: usr.bin/showmount/showmount.c
===================================================================
RCS file: /cvsroot/src/usr.bin/showmount/showmount.c,v
retrieving revision 1.18
diff -u -p -r1.18 showmount.c
--- usr.bin/showmount/showmount.c       27 Feb 2011 10:11:27 -0000      1.18
+++ usr.bin/showmount/showmount.c       25 Aug 2011 05:34:07 -0000
@@ -153,16 +153,16 @@ main(int argc, char **argv)
 
        if (rpcs & DODUMP)
                if ((estat = tcp_callrpc(host, RPCPROG_MNT, mntvers,
-                        RPCMNT_DUMP, xdr_void, (char *)0,
-                        xdr_mntdump, (char *)&mntdump)) != 0) {
+                        RPCMNT_DUMP, (xdrproc_t)xdr_void, (char *)0,
+                        (xdrproc_t)xdr_mntdump, (char *)&mntdump)) != 0) {
                        fprintf(stderr, "showmount: Can't do Mountdump rpc: ");
                        clnt_perrno(estat);
                        exit(1);
                }
        if (rpcs & DOEXPORTS)
                if ((estat = tcp_callrpc(host, RPCPROG_MNT, mntvers,
-                        RPCMNT_EXPORT, xdr_void, (char *)0,
-                        xdr_exports, (char *)&exports)) != 0) {
+                        RPCMNT_EXPORT, (xdrproc_t)xdr_void, (char *)0,
+                        (xdrproc_t)xdr_exports, (char *)&exports)) != 0) {
                        fprintf(stderr, "showmount: Can't do Exports rpc: ");
                        clnt_perrno(estat);
                        exit(1);
Index: usr.bin/ypwhich/ypwhich.c
===================================================================
RCS file: /cvsroot/src/usr.bin/ypwhich/ypwhich.c,v
retrieving revision 1.18
diff -u -p -r1.18 ypwhich.c
--- usr.bin/ypwhich/ypwhich.c   1 Feb 2011 20:58:15 -0000       1.18
+++ usr.bin/ypwhich/ypwhich.c   25 Aug 2011 05:34:13 -0000
@@ -394,7 +394,7 @@ find_mapmaster(const char *host, const c
                        (void)printf("%s %s\n", ypml->ypml_name,
                            yprespmaster.master);
                }
-               xdr_free(xdr_ypresp_master, (void *)&yprespmaster);
+               xdr_free((xdrproc_t)xdr_ypresp_master, (void *)&yprespmaster);
        }
        clnt_destroy(ypserv);
 
Index: usr.sbin/mountd/mountd.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/mountd/mountd.c,v
retrieving revision 1.120
diff -u -p -r1.120 mountd.c
--- usr.sbin/mountd/mountd.c    11 Oct 2009 16:30:19 -0000      1.120
+++ usr.sbin/mountd/mountd.c    25 Aug 2011 05:35:43 -0000
@@ -522,7 +522,7 @@ mntsrv(rqstp, transp)
        ret = 0;
        switch (rqstp->rq_proc) {
        case NULLPROC:
-               if (!svc_sendreply(transp, xdr_void, NULL))
+               if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
                        syslog(LOG_ERR, "Can't send reply");
                return;
        case MOUNTPROC_MNT:
@@ -550,7 +550,7 @@ mntsrv(rqstp, transp)
                        if (debug)
                                (void)fprintf(stderr, "-> stat failed on %s\n",
                                    rdirpath);
-                       if (!svc_sendreply(transp, xdr_long, (caddr_t) &bad))
+                       if (!svc_sendreply(transp, (xdrproc_t)xdr_long, 
(caddr_t) &bad))
                                syslog(LOG_ERR, "Can't send reply");
                        return;
                }
@@ -585,7 +585,7 @@ mntsrv(rqstp, transp)
                        if (getfh(rdirpath, &fhr.fhr_fh, &fh_size) < 0) {
                                bad = errno;
                                syslog(LOG_ERR, "Can't get fh for %s", 
rdirpath);
-                               if (!svc_sendreply(transp, xdr_long,
+                               if (!svc_sendreply(transp, (xdrproc_t)xdr_long,
                                    (char *)&bad))
                                        syslog(LOG_ERR, "Can't send reply");
                                goto out;
@@ -593,13 +593,13 @@ mntsrv(rqstp, transp)
                        if ((fhr.fhr_vers == 1 && fh_size > NFSX_V2FH) ||
                            fh_size > NFSX_V3FHMAX) {
                                bad = EINVAL; /* XXX */
-                               if (!svc_sendreply(transp, xdr_long,
+                               if (!svc_sendreply(transp, (xdrproc_t)xdr_long,
                                    (char *)&bad))
                                        syslog(LOG_ERR, "Can't send reply");
                                goto out;
                        }
                        fhr.fhr_fhsize = fh_size;
-                       if (!svc_sendreply(transp, xdr_fhs, (char *) &fhr))
+                       if (!svc_sendreply(transp, (xdrproc_t)xdr_fhs, (char *) 
&fhr))
                                syslog(LOG_ERR, "Can't send reply");
                        if (!lookup_failed)
                                add_mlist(host, rdirpath, hostset);
@@ -608,14 +608,14 @@ mntsrv(rqstp, transp)
                        if (debug)
                                (void)fprintf(stderr, "Mount successful.\n");
                } else {
-                       if (!svc_sendreply(transp, xdr_long, (caddr_t) &bad))
+                       if (!svc_sendreply(transp, (xdrproc_t)xdr_long, 
(caddr_t) &bad))
                                syslog(LOG_ERR, "Can't send reply");
                }
 out:
                (void)sigprocmask(SIG_UNBLOCK, &sighup_mask, NULL);
                return;
        case MOUNTPROC_DUMP:
-               if (!svc_sendreply(transp, xdr_mlist, NULL))
+               if (!svc_sendreply(transp, (xdrproc_t)xdr_mlist, NULL))
                        syslog(LOG_ERR, "Can't send reply");
                return;
        case MOUNTPROC_UMNT:
@@ -630,7 +630,7 @@ out:
                        svcerr_weakauth(transp);
                        return;
                }
-               if (!svc_sendreply(transp, xdr_void, NULL))
+               if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
                        syslog(LOG_ERR, "Can't send reply");
                return;
        case MOUNTPROC_UMNTALL:
@@ -641,12 +641,12 @@ out:
                        svcerr_weakauth(transp);
                        return;
                }
-               if (!svc_sendreply(transp, xdr_void, NULL))
+               if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
                        syslog(LOG_ERR, "Can't send reply");
                return;
        case MOUNTPROC_EXPORT:
        case MOUNTPROC_EXPORTALL:
-               if (!svc_sendreply(transp, xdr_explist, NULL))
+               if (!svc_sendreply(transp, (xdrproc_t)xdr_explist, NULL))
                        syslog(LOG_ERR, "Can't send reply");
                return;
 
@@ -2367,7 +2367,8 @@ send_umntall(n)
        int n;
 {
        (void)clnt_broadcast(RPCPROG_MNT, RPCMNT_VER1, RPCMNT_UMNTALL,
-           xdr_void, NULL, xdr_void, NULL, (resultproc_t)umntall_each);
+           (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_void, NULL,
+           (resultproc_t)umntall_each);
        exit(0);
 }
 
Index: usr.sbin/rpc.lockd/lockd_lock.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/rpc.lockd/lockd_lock.c,v
retrieving revision 1.31
diff -u -p -r1.31 lockd_lock.c
--- usr.sbin/rpc.lockd/lockd_lock.c     19 Nov 2009 22:27:26 -0000      1.31
+++ usr.sbin/rpc.lockd/lockd_lock.c     25 Aug 2011 05:36:07 -0000
@@ -791,8 +791,9 @@ do_mon(const char *hostname)
        my_mon.mon_id.my_id.my_prog = NLM_PROG;
        my_mon.mon_id.my_id.my_vers = NLM_SM;
        my_mon.mon_id.my_id.my_proc = NLM_SM_NOTIFY;
-       if ((retval = callrpc(localhost, SM_PROG, SM_VERS, SM_MON, xdr_mon,
-           (void *)&my_mon, xdr_sm_stat_res, (void *)&result)) != 0) {
+       if ((retval = callrpc(localhost, SM_PROG, SM_VERS, SM_MON,
+           (xdrproc_t)xdr_mon, (void *)&my_mon,
+           (xdrproc_t)xdr_sm_stat_res, (void *)&result)) != 0) {
                syslog(LOG_WARNING, "rpc to statd failed (%s)",
                    clnt_sperrno((enum clnt_stat)retval));
                free(hp);
Index: usr.sbin/rpc.yppasswdd/rpc.yppasswdd.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/rpc.yppasswdd/rpc.yppasswdd.c,v
retrieving revision 1.14
diff -u -p -r1.14 rpc.yppasswdd.c
--- usr.sbin/rpc.yppasswdd/rpc.yppasswdd.c      24 May 2011 13:27:16 -0000      
1.14
+++ usr.sbin/rpc.yppasswdd/rpc.yppasswdd.c      25 Aug 2011 05:36:10 -0000
@@ -142,7 +142,7 @@ yppasswddprog_1(struct svc_req *rqstp, S
 
        switch (rqstp->rq_proc) {
        case NULLPROC:
-               (void)svc_sendreply(transp, xdr_void, (char *) NULL);
+               (void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *) NULL);
                return;
 
        case YPPASSWDPROC_UPDATE:
Index: usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c,v
retrieving revision 1.17
diff -u -p -r1.17 yppasswdd_mkpw.c
--- usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c     20 Oct 2009 00:51:14 -0000      
1.17
+++ usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c     25 Aug 2011 05:36:16 -0000
@@ -74,7 +74,7 @@ make_passwd(yppasswd *argp, struct svc_r
 
 #define REPLY(val)     do { \
                int res = (val); \
-               if (!svc_sendreply(transp, xdr_int, (caddr_t)&res)) \
+               if (!svc_sendreply(transp, (xdrproc_t)xdr_int, (caddr_t)&res)) \
                        svcerr_systemerr(transp); \
        } while (0)
 
Index: usr.sbin/ypbind/ypbind.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/ypbind/ypbind.c,v
retrieving revision 1.88
diff -u -p -r1.88 ypbind.c
--- usr.sbin/ypbind/ypbind.c    25 May 2011 04:59:22 -0000      1.88
+++ usr.sbin/ypbind/ypbind.c    25 Aug 2011 05:36:42 -0000
@@ -576,14 +576,14 @@ ypbindprog_2(struct svc_req *rqstp, regi
 
        switch (rqstp->rq_proc) {
        case YPBINDPROC_NULL:
-               xdr_argument = xdr_void;
-               xdr_result = xdr_void;
+               xdr_argument = (xdrproc_t)xdr_void;
+               xdr_result = (xdrproc_t)xdr_void;
                local = ypbindproc_null_2;
                break;
 
        case YPBINDPROC_DOMAIN:
-               xdr_argument = xdr_ypdomain_wrap_string;
-               xdr_result = xdr_ypbind_resp;
+               xdr_argument = (xdrproc_t)xdr_ypdomain_wrap_string;
+               xdr_result = (xdrproc_t)xdr_ypbind_resp;
                local = ypbindproc_domain_2;
                break;
 
@@ -601,8 +601,8 @@ ypbindprog_2(struct svc_req *rqstp, regi
                        return;
                }
 
-               xdr_argument = xdr_ypbind_setdom;
-               xdr_result = xdr_void;
+               xdr_argument = (xdrproc_t)xdr_ypbind_setdom;
+               xdr_result = (xdrproc_t)xdr_void;
                local = ypbindproc_setdom_2;
                break;
 
@@ -663,7 +663,7 @@ sunrpc_setup(void)
        rmtca.xdr_args = NULL;          /* set at call time */
        rmtca.args_ptr = NULL;          /* set at call time */
        rmtcr.port_ptr = &rmtcr_port;
-       rmtcr.xdr_results = xdr_bool;
+       rmtcr.xdr_results = (xdrproc_t)xdr_bool;
        rmtcr.results_ptr = (caddr_t)(void *)&rmtcr_outval;
 }
 
@@ -874,7 +874,7 @@ recv_again:
        (void)memset(&msg, 0, sizeof(msg));
        msg.acpted_rply.ar_verf = _null_auth;
        msg.acpted_rply.ar_results.where = (caddr_t)(void *)&rmtcr;
-       msg.acpted_rply.ar_results.proc = xdr_rmtcallres;
+       msg.acpted_rply.ar_results.proc = (xdrproc_t)xdr_rmtcallres;
 
 try_again:
        fromlen = sizeof(struct sockaddr);
@@ -905,7 +905,7 @@ try_again:
                }
        }
        xdr.x_op = XDR_FREE;
-       msg.acpted_rply.ar_results.proc = xdr_void;
+       msg.acpted_rply.ar_results.proc = (xdrproc_t)xdr_void;
        xdr_destroy(&xdr);
 
        return RPC_SUCCESS;
@@ -929,7 +929,7 @@ recv_again:
        (void)memset(&msg, 0, sizeof(msg));
        msg.acpted_rply.ar_verf = _null_auth;
        msg.acpted_rply.ar_results.where = (caddr_t)(void *)&res;
-       msg.acpted_rply.ar_results.proc = xdr_bool;
+       msg.acpted_rply.ar_results.proc = (xdrproc_t)xdr_bool;
 
 try_again:
        fromlen = sizeof (struct sockaddr);
@@ -959,7 +959,7 @@ try_again:
                }
        }
        xdr.x_op = XDR_FREE;
-       msg.acpted_rply.ar_results.proc = xdr_void;
+       msg.acpted_rply.ar_results.proc = (xdrproc_t)xdr_void;
        xdr_destroy(&xdr);
 
        return RPC_SUCCESS;
@@ -977,7 +977,7 @@ nag_servers(struct domain *dom)
        XDR xdr;
 
        DPRINTF("nag_servers\n");
-       rmtca.xdr_args = xdr_ypdomain_wrap_string;
+       rmtca.xdr_args = (xdrproc_t)xdr_ypdomain_wrap_string;
        rmtca.args_ptr = (caddr_t)(void *)&dom_name;
 
        (void)memset(&xdr, 0, sizeof xdr);
Index: usr.sbin/yppoll/yppoll.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/yppoll/yppoll.c,v
retrieving revision 1.14
diff -u -p -r1.14 yppoll.c
--- usr.sbin/yppoll/yppoll.c    25 Jan 2008 19:58:54 -0000      1.14
+++ usr.sbin/yppoll/yppoll.c    25 Aug 2011 05:36:42 -0000
@@ -201,7 +201,7 @@ get_remote_info(const char *indomain, co
                clnt_perror(client, "yp_order: clnt_call");
 
        *outorder = ypro.ordernum;
-       xdr_free(xdr_ypresp_order, (void *)&ypro);
+       xdr_free((xdrproc_t)xdr_ypresp_order, (void *)&ypro);
 
        r = ypprot_err(ypro.status);
        if (r == RPC_SUCCESS) {
@@ -214,7 +214,7 @@ get_remote_info(const char *indomain, co
                r = ypprot_err(yprm.status);
                if (r == 0)
                        *outname = (char *)strdup(yprm.master);
-               xdr_free(xdr_ypresp_master, (void *)&yprm);
+               xdr_free((xdrproc_t)xdr_ypresp_master, (void *)&yprm);
        }
        clnt_destroy(client);
        return r;
Index: usr.sbin/ypserv/common/yplib_host.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/ypserv/common/yplib_host.c,v
retrieving revision 1.8
diff -u -p -r1.8 yplib_host.c
--- usr.sbin/ypserv/common/yplib_host.c 19 Apr 2009 06:06:39 -0000      1.8
+++ usr.sbin/ypserv/common/yplib_host.c 25 Aug 2011 05:36:42 -0000
@@ -152,7 +152,7 @@ yp_match_host(CLIENT *client, char *indo
                memcpy(*outval, yprv.valdat.dptr, *outvallen);
                (*outval)[*outvallen] = '\0';
        }
-       xdr_free(xdr_ypresp_val, (char *)&yprv);
+       xdr_free((xdrproc_t)xdr_ypresp_val, (char *)&yprv);
        return r;
 }
 
@@ -186,7 +186,7 @@ yp_first_host(CLIENT *client, char *indo
                memcpy(*outval, yprkv.valdat.dptr, *outvallen);
                (*outval)[*outvallen] = '\0';
        }
-       xdr_free(xdr_ypresp_key_val, (char *)&yprkv);
+       xdr_free((xdrproc_t)xdr_ypresp_key_val, (char *)&yprkv);
        return r;
 }
 
@@ -223,7 +223,7 @@ yp_next_host(CLIENT *client, char *indom
                memcpy(*outval, yprkv.valdat.dptr, *outvallen);
                (*outval)[*outvallen] = '\0';
        }
-       xdr_free(xdr_ypresp_key_val, (char *)&yprkv);
+       xdr_free((xdrproc_t)xdr_ypresp_key_val, (char *)&yprkv);
        return r;
 }
 
@@ -264,7 +264,7 @@ yp_order_host(CLIENT *client, char *indo
                clnt_perror(client, "yp_order_host: clnt_call");
 
        *outorder = ypro.ordernum;
-       xdr_free(xdr_ypresp_order, (char *)&ypro);
+       xdr_free((xdrproc_t)xdr_ypresp_order, (char *)&ypro);
        return ypprot_err(ypro.status);
 }
 
@@ -288,7 +288,7 @@ yp_master_host(CLIENT *client, char *ind
        if (!(r = ypprot_err(yprm.status))) {
                *outname = (char *)strdup(yprm.master);
        }
-       xdr_free(xdr_ypresp_master, (char *)&yprm);
+       xdr_free((xdrproc_t)xdr_ypresp_master, (char *)&yprm);
        return r;
 }
 
Index: usr.sbin/ypserv/yppush/yppush_svc.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/ypserv/yppush/yppush_svc.c,v
retrieving revision 1.9
diff -u -p -r1.9 yppush_svc.c
--- usr.sbin/ypserv/yppush/yppush_svc.c 21 Oct 2009 00:01:57 -0000      1.9
+++ usr.sbin/ypserv/yppush/yppush_svc.c 25 Aug 2011 05:36:44 -0000
@@ -92,14 +92,14 @@ yppush_xfrrespprog_1(struct svc_req *rqs
        _rpcsvcdirty = 1;
        switch (rqstp->rq_proc) {
        case YPPUSHPROC_NULL:
-               xdr_argument = xdr_void;
-               xdr_result = xdr_void;
+               xdr_argument = (xdrproc_t)xdr_void;
+               xdr_result = (xdrproc_t)xdr_void;
                local = yppushproc_null_1_svc;
                break;
 
        case YPPUSHPROC_XFRRESP:
-               xdr_argument = xdr_yppushresp_xfr;
-               xdr_result = xdr_void;
+               xdr_argument = (xdrproc_t)xdr_yppushresp_xfr;
+               xdr_result = (xdrproc_t)xdr_void;
                local = yppushproc_xfrresp_1_svc;
                break;
 
Index: usr.sbin/ypserv/ypserv/ypserv.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/ypserv/ypserv/ypserv.c,v
retrieving revision 1.24
diff -u -p -r1.24 ypserv.c
--- usr.sbin/ypserv/ypserv/ypserv.c     25 Apr 2011 22:54:05 -0000      1.24
+++ usr.sbin/ypserv/ypserv/ypserv.c     25 Aug 2011 05:37:13 -0000
@@ -155,85 +155,85 @@ ypprog_2(struct svc_req *rqstp, SVCXPRT 
 
        switch (rqstp->rq_proc) {
        case YPPROC_NULL:
-               xdr_argument = xdr_void;
-               xdr_result = xdr_void;
+               xdr_argument = (xdrproc_t)xdr_void;
+               xdr_result = (xdrproc_t)xdr_void;
                local = ypproc_null_2_svc;
                SVCNAME("null_2");
                break;
 
        case YPPROC_DOMAIN:
-               xdr_argument = xdr_ypdomain_wrap_string;
-               xdr_result = xdr_bool;
+               xdr_argument = (xdrproc_t)xdr_ypdomain_wrap_string;
+               xdr_result = (xdrproc_t)xdr_bool;
                local = ypproc_domain_2_svc;
                SVCNAME("domain_2");
                break;
 
        case YPPROC_DOMAIN_NONACK:
-               xdr_argument = xdr_ypdomain_wrap_string;
-               xdr_result = xdr_bool;
+               xdr_argument = (xdrproc_t)xdr_ypdomain_wrap_string;
+               xdr_result = (xdrproc_t)xdr_bool;
                local = ypproc_domain_nonack_2_svc;
                SVCNAME("domain_nonack_2");
                break;
 
        case YPPROC_MATCH:
-               xdr_argument = xdr_ypreq_key;
-               xdr_result = xdr_ypresp_val;
+               xdr_argument = (xdrproc_t)xdr_ypreq_key;
+               xdr_result = (xdrproc_t)xdr_ypresp_val;
                local = ypproc_match_2_svc;
                SVCNAME("match_2");
                break;
 
        case YPPROC_FIRST:
-               xdr_argument = xdr_ypreq_nokey;
-               xdr_result = xdr_ypresp_key_val;
+               xdr_argument = (xdrproc_t)xdr_ypreq_nokey;
+               xdr_result = (xdrproc_t)xdr_ypresp_key_val;
                local = ypproc_first_2_svc;
                SVCNAME("first_2");
                break;
 
        case YPPROC_NEXT:
-               xdr_argument = xdr_ypreq_key;
-               xdr_result = xdr_ypresp_key_val;
+               xdr_argument = (xdrproc_t)xdr_ypreq_key;
+               xdr_result = (xdrproc_t)xdr_ypresp_key_val;
                local = ypproc_next_2_svc;
                SVCNAME("next_2");
                break;
 
        case YPPROC_XFR:
-               xdr_argument = xdr_ypreq_xfr;
-               xdr_result = xdr_ypresp_xfr;
+               xdr_argument = (xdrproc_t)xdr_ypreq_xfr;
+               xdr_result = (xdrproc_t)xdr_ypresp_xfr;
                local = ypproc_xfr_2_svc;
                SVCNAME("xfer_2");
                break;
 
        case YPPROC_CLEAR:
-               xdr_argument = xdr_void;
-               xdr_result = xdr_void;
+               xdr_argument = (xdrproc_t)xdr_void;
+               xdr_result = (xdrproc_t)xdr_void;
                local = ypproc_clear_2_svc;
                SVCNAME("clear_2");
                break;
 
        case YPPROC_ALL:
-               xdr_argument = xdr_ypreq_nokey;
-               xdr_result = xdr_ypresp_all;
+               xdr_argument = (xdrproc_t)xdr_ypreq_nokey;
+               xdr_result = (xdrproc_t)xdr_ypresp_all;
                local = ypproc_all_2_svc;
                SVCNAME("all_2");
                break;
 
        case YPPROC_MASTER:
-               xdr_argument = xdr_ypreq_nokey;
-               xdr_result = xdr_ypresp_master;
+               xdr_argument = (xdrproc_t)xdr_ypreq_nokey;
+               xdr_result = (xdrproc_t)xdr_ypresp_master;
                local = ypproc_master_2_svc;
                SVCNAME("master_2");
                break;
 
        case YPPROC_ORDER:
-               xdr_argument = xdr_ypreq_nokey;
-               xdr_result = xdr_ypresp_order;
+               xdr_argument = (xdrproc_t)xdr_ypreq_nokey;
+               xdr_result = (xdrproc_t)xdr_ypresp_order;
                local = ypproc_order_2_svc;
                SVCNAME("order_2");
                break;
 
        case YPPROC_MAPLIST:
-               xdr_argument = xdr_ypdomain_wrap_string;
-               xdr_result = xdr_ypresp_maplist;
+               xdr_argument = (xdrproc_t)xdr_ypdomain_wrap_string;
+               xdr_result = (xdrproc_t)xdr_ypresp_maplist;
                local = ypproc_maplist_2_svc;
                SVCNAME("maplist_2");
                break;
Index: usr.sbin/ypserv/ypserv/ypserv_proc.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/ypserv/ypserv/ypserv_proc.c,v
retrieving revision 1.15
diff -u -p -r1.15 ypserv_proc.c
--- usr.sbin/ypserv/ypserv/ypserv_proc.c        1 Jul 2011 03:09:29 -0000       
1.15
+++ usr.sbin/ypserv/ypserv/ypserv_proc.c        25 Aug 2011 05:37:19 -0000
@@ -337,7 +337,7 @@ ypproc_all_2_svc(void *argp, struct svc_
 
        case 0:
                /* CHILD: send result, then exit */
-               if (!svc_sendreply(rqstp->rq_xprt, ypdb_xdr_get_all, (void *)k))
+               if (!svc_sendreply(rqstp->rq_xprt, (xdrproc_t)ypdb_xdr_get_all, 
(void *)k))
                        svcerr_systemerr(rqstp->rq_xprt);
 
                /* Note: no need to free args; we're exiting. */


Home | Main Index | Thread Index | Old Index