Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/rpc Increment to the value, not the pointer. (Thors...



details:   https://anonhg.NetBSD.org/src/rev/073d60d8e6a7
branches:  trunk
changeset: 326168:073d60d8e6a7
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jan 21 17:39:24 2014 +0000

description:
Increment to the value, not the pointer. (Thorsten Brehm)

diffstat:

 lib/libc/rpc/clnt_vc.c |  17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diffs (67 lines):

diff -r ac02369d65e8 -r 073d60d8e6a7 lib/libc/rpc/clnt_vc.c
--- a/lib/libc/rpc/clnt_vc.c    Tue Jan 21 16:40:24 2014 +0000
+++ b/lib/libc/rpc/clnt_vc.c    Tue Jan 21 17:39:24 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clnt_vc.c,v 1.24 2013/10/17 23:58:05 christos Exp $    */
+/*     $NetBSD: clnt_vc.c,v 1.25 2014/01/21 17:39:24 christos Exp $    */
 
 /*
  * Copyright (c) 2010, Oracle America, Inc.
@@ -38,7 +38,7 @@
 static char *sccsid = "@(#)clnt_tcp.c  2.2 88/08/01 4.0 RPCSRC";
 static char sccsid[] = "@(#)clnt_vc.c 1.19 89/03/16 Copyr 1988 Sun Micro";
 #else
-__RCSID("$NetBSD: clnt_vc.c,v 1.24 2013/10/17 23:58:05 christos Exp $");
+__RCSID("$NetBSD: clnt_vc.c,v 1.25 2014/01/21 17:39:24 christos Exp $");
 #endif
 #endif
  
@@ -145,16 +145,16 @@
 #endif
 
 static __inline void
-htonlp(void *dst, const void *src)
+htonlp(void *dst, const void *src, uint32_t incr)
 {
 #if 0
        uint32_t tmp;
        memcpy(&tmp, src, sizeof(tmp));
-       tmp = htonl(tmp);
+       tmp = htonl(tmp + incr);
        memcpy(dst, &tmp, sizeof(tmp));
 #else
        /* We are aligned, so we think */
-       *(uint32_t *)dst = htonl(*(const uint32_t *)src);
+       *(uint32_t *)dst = htonl(*(const uint32_t *)src + incr);
 #endif
 }
 
@@ -609,9 +609,8 @@
                break;
        case CLSET_XID:
                /* This will set the xid of the NEXT call */
-               htonlp(&ct->ct_u.ct_mcalli, (const char *)info +
-                   sizeof(uint32_t));
                /* increment by 1 as clnt_vc_call() decrements once */
+               htonlp(&ct->ct_u.ct_mcalli, info, 1);
                break;
        case CLGET_VERS:
                /*
@@ -624,7 +623,7 @@
                break;
 
        case CLSET_VERS:
-               htonlp(ct->ct_u.ct_mcallc + 4 * BYTES_PER_XDR_UNIT, info);
+               htonlp(ct->ct_u.ct_mcallc + 4 * BYTES_PER_XDR_UNIT, info, 0);
                break;
 
        case CLGET_PROG:
@@ -638,7 +637,7 @@
                break;
 
        case CLSET_PROG:
-               htonlp(ct->ct_u.ct_mcallc + 3 * BYTES_PER_XDR_UNIT, info);
+               htonlp(ct->ct_u.ct_mcallc + 3 * BYTES_PER_XDR_UNIT, info, 0);
                break;
 
        default:



Home | Main Index | Thread Index | Old Index