aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/svc.c')
-rw-r--r--net/sunrpc/svc.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index b76a227dd3ad..44b8d9d4c18a 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -256,11 +256,11 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
256 struct kvec * argv = &rqstp->rq_arg.head[0]; 256 struct kvec * argv = &rqstp->rq_arg.head[0];
257 struct kvec * resv = &rqstp->rq_res.head[0]; 257 struct kvec * resv = &rqstp->rq_res.head[0];
258 kxdrproc_t xdr; 258 kxdrproc_t xdr;
259 u32 *statp; 259 __be32 *statp;
260 u32 dir, prog, vers, proc, 260 u32 dir, prog, vers, proc;
261 auth_stat, rpc_stat; 261 __be32 auth_stat, rpc_stat;
262 int auth_res; 262 int auth_res;
263 u32 *accept_statp; 263 __be32 *accept_statp;
264 264
265 rpc_stat = rpc_success; 265 rpc_stat = rpc_success;
266 266
@@ -284,16 +284,16 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
284 rqstp->rq_sendfile_ok = 1; 284 rqstp->rq_sendfile_ok = 1;
285 /* tcp needs a space for the record length... */ 285 /* tcp needs a space for the record length... */
286 if (rqstp->rq_prot == IPPROTO_TCP) 286 if (rqstp->rq_prot == IPPROTO_TCP)
287 svc_putu32(resv, 0); 287 svc_putnl(resv, 0);
288 288
289 rqstp->rq_xid = svc_getu32(argv); 289 rqstp->rq_xid = svc_getu32(argv);
290 svc_putu32(resv, rqstp->rq_xid); 290 svc_putu32(resv, rqstp->rq_xid);
291 291
292 dir = ntohl(svc_getu32(argv)); 292 dir = svc_getnl(argv);
293 vers = ntohl(svc_getu32(argv)); 293 vers = svc_getnl(argv);
294 294
295 /* First words of reply: */ 295 /* First words of reply: */
296 svc_putu32(resv, xdr_one); /* REPLY */ 296 svc_putnl(resv, 1); /* REPLY */
297 297
298 if (dir != 0) /* direction != CALL */ 298 if (dir != 0) /* direction != CALL */
299 goto err_bad_dir; 299 goto err_bad_dir;
@@ -303,11 +303,11 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
303 /* Save position in case we later decide to reject: */ 303 /* Save position in case we later decide to reject: */
304 accept_statp = resv->iov_base + resv->iov_len; 304 accept_statp = resv->iov_base + resv->iov_len;
305 305
306 svc_putu32(resv, xdr_zero); /* ACCEPT */ 306 svc_putnl(resv, 0); /* ACCEPT */
307 307
308 rqstp->rq_prog = prog = ntohl(svc_getu32(argv)); /* program number */ 308 rqstp->rq_prog = prog = svc_getnl(argv); /* program number */
309 rqstp->rq_vers = vers = ntohl(svc_getu32(argv)); /* version number */ 309 rqstp->rq_vers = vers = svc_getnl(argv); /* version number */
310 rqstp->rq_proc = proc = ntohl(svc_getu32(argv)); /* procedure number */ 310 rqstp->rq_proc = proc = svc_getnl(argv); /* procedure number */
311 311
312 progp = serv->sv_program; 312 progp = serv->sv_program;
313 313
@@ -361,7 +361,7 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
361 361
362 /* Build the reply header. */ 362 /* Build the reply header. */
363 statp = resv->iov_base +resv->iov_len; 363 statp = resv->iov_base +resv->iov_len;
364 svc_putu32(resv, rpc_success); /* RPC_SUCCESS */ 364 svc_putnl(resv, RPC_SUCCESS);
365 365
366 /* Bump per-procedure stats counter */ 366 /* Bump per-procedure stats counter */
367 procp->pc_count++; 367 procp->pc_count++;
@@ -439,10 +439,10 @@ err_bad_dir:
439 439
440err_bad_rpc: 440err_bad_rpc:
441 serv->sv_stats->rpcbadfmt++; 441 serv->sv_stats->rpcbadfmt++;
442 svc_putu32(resv, xdr_one); /* REJECT */ 442 svc_putnl(resv, 1); /* REJECT */
443 svc_putu32(resv, xdr_zero); /* RPC_MISMATCH */ 443 svc_putnl(resv, 0); /* RPC_MISMATCH */
444 svc_putu32(resv, xdr_two); /* Only RPCv2 supported */ 444 svc_putnl(resv, 2); /* Only RPCv2 supported */
445 svc_putu32(resv, xdr_two); 445 svc_putnl(resv, 2);
446 goto sendit; 446 goto sendit;
447 447
448err_bad_auth: 448err_bad_auth:
@@ -450,15 +450,15 @@ err_bad_auth:
450 serv->sv_stats->rpcbadauth++; 450 serv->sv_stats->rpcbadauth++;
451 /* Restore write pointer to location of accept status: */ 451 /* Restore write pointer to location of accept status: */
452 xdr_ressize_check(rqstp, accept_statp); 452 xdr_ressize_check(rqstp, accept_statp);
453 svc_putu32(resv, xdr_one); /* REJECT */ 453 svc_putnl(resv, 1); /* REJECT */
454 svc_putu32(resv, xdr_one); /* AUTH_ERROR */ 454 svc_putnl(resv, 1); /* AUTH_ERROR */
455 svc_putu32(resv, auth_stat); /* status */ 455 svc_putnl(resv, ntohl(auth_stat)); /* status */
456 goto sendit; 456 goto sendit;
457 457
458err_bad_prog: 458err_bad_prog:
459 dprintk("svc: unknown program %d\n", prog); 459 dprintk("svc: unknown program %d\n", prog);
460 serv->sv_stats->rpcbadfmt++; 460 serv->sv_stats->rpcbadfmt++;
461 svc_putu32(resv, rpc_prog_unavail); 461 svc_putnl(resv, RPC_PROG_UNAVAIL);
462 goto sendit; 462 goto sendit;
463 463
464err_bad_vers: 464err_bad_vers:
@@ -466,9 +466,9 @@ err_bad_vers:
466 printk("svc: unknown version (%d)\n", vers); 466 printk("svc: unknown version (%d)\n", vers);
467#endif 467#endif
468 serv->sv_stats->rpcbadfmt++; 468 serv->sv_stats->rpcbadfmt++;
469 svc_putu32(resv, rpc_prog_mismatch); 469 svc_putnl(resv, RPC_PROG_MISMATCH);
470 svc_putu32(resv, htonl(progp->pg_lovers)); 470 svc_putnl(resv, progp->pg_lovers);
471 svc_putu32(resv, htonl(progp->pg_hivers)); 471 svc_putnl(resv, progp->pg_hivers);
472 goto sendit; 472 goto sendit;
473 473
474err_bad_proc: 474err_bad_proc:
@@ -476,7 +476,7 @@ err_bad_proc:
476 printk("svc: unknown procedure (%d)\n", proc); 476 printk("svc: unknown procedure (%d)\n", proc);
477#endif 477#endif
478 serv->sv_stats->rpcbadfmt++; 478 serv->sv_stats->rpcbadfmt++;
479 svc_putu32(resv, rpc_proc_unavail); 479 svc_putnl(resv, RPC_PROC_UNAVAIL);
480 goto sendit; 480 goto sendit;
481 481
482err_garbage: 482err_garbage:
@@ -486,6 +486,6 @@ err_garbage:
486 rpc_stat = rpc_garbage_args; 486 rpc_stat = rpc_garbage_args;
487err_bad: 487err_bad:
488 serv->sv_stats->rpcbadfmt++; 488 serv->sv_stats->rpcbadfmt++;
489 svc_putu32(resv, rpc_stat); 489 svc_putnl(resv, ntohl(rpc_stat));
490 goto sendit; 490 goto sendit;
491} 491}