Module Name:    src
Committed By:   christos
Date:           Tue Jan 21 17:39:24 UTC 2014

Modified Files:
        src/lib/libc/rpc: clnt_vc.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/rpc/clnt_vc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/rpc/clnt_vc.c
diff -u src/lib/libc/rpc/clnt_vc.c:1.24 src/lib/libc/rpc/clnt_vc.c:1.25
--- src/lib/libc/rpc/clnt_vc.c:1.24	Thu Oct 17 19:58:05 2013
+++ src/lib/libc/rpc/clnt_vc.c	Tue Jan 21 12:39:24 2014
@@ -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 1.
 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 @@ static cond_t   *vc_cv;
 #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 @@ clnt_vc_control(
 		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 @@ clnt_vc_control(
 		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 @@ clnt_vc_control(
 		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:

Reply via email to