summaryrefslogtreecommitdiff
path: root/libc/sunrpc/clnt_unix.c
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-12-22 19:27:39 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-12-22 19:27:39 +0000
commit8a031172c235ab0def5763dd5f3a00f9ff10c053 (patch)
tree11ba9c29e8edc754174f18e6db425971144769c9 /libc/sunrpc/clnt_unix.c
parenta179b968417641981213cfe422c741141d8394e4 (diff)
downloadeglibc2-8a031172c235ab0def5763dd5f3a00f9ff10c053.tar.gz
Merge changes between r16068 and r16332 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@16333 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sunrpc/clnt_unix.c')
-rw-r--r--libc/sunrpc/clnt_unix.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/libc/sunrpc/clnt_unix.c b/libc/sunrpc/clnt_unix.c
index 62dc8c604..282127bb8 100644
--- a/libc/sunrpc/clnt_unix.c
+++ b/libc/sunrpc/clnt_unix.c
@@ -338,7 +338,8 @@ static bool_t
clntunix_control (CLIENT *cl, int request, char *info)
{
struct ct_data *ct = (struct ct_data *) cl->cl_private;
-
+ u_long *mcall_ptr;
+ u_long ul;
switch (request)
{
@@ -366,11 +367,24 @@ clntunix_control (CLIENT *cl, int request, char *info)
* first element in the call structure *.
* This will get the xid of the PREVIOUS call
*/
+#if 0
+ /* This original code has aliasing issues. */
*(u_long *) info = ntohl (*(u_long *)ct->ct_mcall);
+#else
+ mcall_ptr = (u_long *)ct->ct_mcall;
+ ul = ntohl (*mcall_ptr);
+ memcpy (info, &ul, sizeof (ul));
+#endif
break;
case CLSET_XID:
/* This will set the xid of the NEXT call */
+#if 0
+ /* This original code has aliasing issues. */
*(u_long *) ct->ct_mcall = htonl (*(u_long *)info - 1);
+#else
+ ul = ntohl (*(u_long *)info - 1);
+ memcpy (ct->ct_mcall, &ul, sizeof (ul));
+#endif
/* decrement by 1 as clntunix_call() increments once */
break;
case CLGET_VERS: