summaryrefslogtreecommitdiffstats
path: root/fs/afs/vlclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/afs/vlclient.c')
-rw-r--r--fs/afs/vlclient.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/afs/vlclient.c b/fs/afs/vlclient.c
index 5d8562f1ad4a..1ed7e2fd2f35 100644
--- a/fs/afs/vlclient.c
+++ b/fs/afs/vlclient.c
@@ -303,7 +303,7 @@ struct afs_addr_list *afs_vl_get_addrs_u(struct afs_net *net,
303 r->uuid.clock_seq_hi_and_reserved = htonl(u->clock_seq_hi_and_reserved); 303 r->uuid.clock_seq_hi_and_reserved = htonl(u->clock_seq_hi_and_reserved);
304 r->uuid.clock_seq_low = htonl(u->clock_seq_low); 304 r->uuid.clock_seq_low = htonl(u->clock_seq_low);
305 for (i = 0; i < 6; i++) 305 for (i = 0; i < 6; i++)
306 r->uuid.node[i] = ntohl(u->node[i]); 306 r->uuid.node[i] = htonl(u->node[i]);
307 307
308 trace_afs_make_vl_call(call); 308 trace_afs_make_vl_call(call);
309 return (struct afs_addr_list *)afs_make_call(ac, call, GFP_KERNEL, false); 309 return (struct afs_addr_list *)afs_make_call(ac, call, GFP_KERNEL, false);
@@ -450,7 +450,7 @@ again:
450 call->count2 = ntohl(*bp); /* Type or next count */ 450 call->count2 = ntohl(*bp); /* Type or next count */
451 451
452 if (call->count > YFS_MAXENDPOINTS) 452 if (call->count > YFS_MAXENDPOINTS)
453 return -EBADMSG; 453 return afs_protocol_error(call, -EBADMSG);
454 454
455 alist = afs_alloc_addrlist(call->count, FS_SERVICE, AFS_FS_PORT); 455 alist = afs_alloc_addrlist(call->count, FS_SERVICE, AFS_FS_PORT);
456 if (!alist) 456 if (!alist)
@@ -474,7 +474,7 @@ again:
474 size = sizeof(__be32) * (1 + 4 + 1); 474 size = sizeof(__be32) * (1 + 4 + 1);
475 break; 475 break;
476 default: 476 default:
477 return -EBADMSG; 477 return afs_protocol_error(call, -EBADMSG);
478 } 478 }
479 479
480 size += sizeof(__be32); 480 size += sizeof(__be32);
@@ -487,24 +487,24 @@ again:
487 switch (call->count2) { 487 switch (call->count2) {
488 case YFS_ENDPOINT_IPV4: 488 case YFS_ENDPOINT_IPV4:
489 if (ntohl(bp[0]) != sizeof(__be32) * 2) 489 if (ntohl(bp[0]) != sizeof(__be32) * 2)
490 return -EBADMSG; 490 return afs_protocol_error(call, -EBADMSG);
491 afs_merge_fs_addr4(alist, bp[1], ntohl(bp[2])); 491 afs_merge_fs_addr4(alist, bp[1], ntohl(bp[2]));
492 bp += 3; 492 bp += 3;
493 break; 493 break;
494 case YFS_ENDPOINT_IPV6: 494 case YFS_ENDPOINT_IPV6:
495 if (ntohl(bp[0]) != sizeof(__be32) * 5) 495 if (ntohl(bp[0]) != sizeof(__be32) * 5)
496 return -EBADMSG; 496 return afs_protocol_error(call, -EBADMSG);
497 afs_merge_fs_addr6(alist, bp + 1, ntohl(bp[5])); 497 afs_merge_fs_addr6(alist, bp + 1, ntohl(bp[5]));
498 bp += 6; 498 bp += 6;
499 break; 499 break;
500 default: 500 default:
501 return -EBADMSG; 501 return afs_protocol_error(call, -EBADMSG);
502 } 502 }
503 503
504 /* Got either the type of the next entry or the count of 504 /* Got either the type of the next entry or the count of
505 * volEndpoints if no more fsEndpoints. 505 * volEndpoints if no more fsEndpoints.
506 */ 506 */
507 call->count2 = htonl(*bp++); 507 call->count2 = ntohl(*bp++);
508 508
509 call->offset = 0; 509 call->offset = 0;
510 call->count--; 510 call->count--;
@@ -517,7 +517,7 @@ again:
517 if (!call->count) 517 if (!call->count)
518 goto end; 518 goto end;
519 if (call->count > YFS_MAXENDPOINTS) 519 if (call->count > YFS_MAXENDPOINTS)
520 return -EBADMSG; 520 return afs_protocol_error(call, -EBADMSG);
521 521
522 call->unmarshall = 3; 522 call->unmarshall = 3;
523 523
@@ -531,7 +531,7 @@ again:
531 return ret; 531 return ret;
532 532
533 bp = call->buffer; 533 bp = call->buffer;
534 call->count2 = htonl(*bp++); 534 call->count2 = ntohl(*bp++);
535 call->offset = 0; 535 call->offset = 0;
536 call->unmarshall = 4; 536 call->unmarshall = 4;
537 537
@@ -545,7 +545,7 @@ again:
545 size = sizeof(__be32) * (1 + 4 + 1); 545 size = sizeof(__be32) * (1 + 4 + 1);
546 break; 546 break;
547 default: 547 default:
548 return -EBADMSG; 548 return afs_protocol_error(call, -EBADMSG);
549 } 549 }
550 550
551 if (call->count > 1) 551 if (call->count > 1)
@@ -558,16 +558,16 @@ again:
558 switch (call->count2) { 558 switch (call->count2) {
559 case YFS_ENDPOINT_IPV4: 559 case YFS_ENDPOINT_IPV4:
560 if (ntohl(bp[0]) != sizeof(__be32) * 2) 560 if (ntohl(bp[0]) != sizeof(__be32) * 2)
561 return -EBADMSG; 561 return afs_protocol_error(call, -EBADMSG);
562 bp += 3; 562 bp += 3;
563 break; 563 break;
564 case YFS_ENDPOINT_IPV6: 564 case YFS_ENDPOINT_IPV6:
565 if (ntohl(bp[0]) != sizeof(__be32) * 5) 565 if (ntohl(bp[0]) != sizeof(__be32) * 5)
566 return -EBADMSG; 566 return afs_protocol_error(call, -EBADMSG);
567 bp += 6; 567 bp += 6;
568 break; 568 break;
569 default: 569 default:
570 return -EBADMSG; 570 return afs_protocol_error(call, -EBADMSG);
571 } 571 }
572 572
573 /* Got either the type of the next entry or the count of 573 /* Got either the type of the next entry or the count of
@@ -576,7 +576,7 @@ again:
576 call->offset = 0; 576 call->offset = 0;
577 call->count--; 577 call->count--;
578 if (call->count > 0) { 578 if (call->count > 0) {
579 call->count2 = htonl(*bp++); 579 call->count2 = ntohl(*bp++);
580 goto again; 580 goto again;
581 } 581 }
582 582