From 8250503f218be1a3fa434e905631b1636cf6d033 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 23 Apr 2012 14:42:58 +0200 Subject: librpc: PR2066: Fix for short enums The XDR library has a problem on architectures with short enums like the default ARM EABI. Short enums means that the size of the enum type is variable and the smallest integer type to hold all enum values will be selected. For many enums this is char. The XDR library uses int32_t for enum_t. There are several evil casts from an enum type to enum_t which leads to invalid memory accesses on short enum architectures. A workaround is to add appropriate dummy enum values. --- cpukit/librpc/include/rpc/rpc_msg.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'cpukit/librpc/include/rpc/rpc_msg.h') diff --git a/cpukit/librpc/include/rpc/rpc_msg.h b/cpukit/librpc/include/rpc/rpc_msg.h index 1668fbf7ee..63a1f360a0 100644 --- a/cpukit/librpc/include/rpc/rpc_msg.h +++ b/cpukit/librpc/include/rpc/rpc_msg.h @@ -58,12 +58,14 @@ struct rpc_err; /* forward */ enum msg_type { CALL=0, - REPLY=1 + REPLY=1, + _MSG_TYPE = 0xffffffff }; enum reply_stat { MSG_ACCEPTED=0, - MSG_DENIED=1 + MSG_DENIED=1, + _REPLY_STAT = 0xffffffff }; enum accept_stat { @@ -72,12 +74,14 @@ enum accept_stat { PROG_MISMATCH=2, PROC_UNAVAIL=3, GARBAGE_ARGS=4, - SYSTEM_ERR=5 + SYSTEM_ERR=5, + _ACCEPT_STAT = 0xffffffff }; enum reject_stat { RPC_MISMATCH=0, - AUTH_ERROR=1 + AUTH_ERROR=1, + _REJECT_STAT = 0xffffffff }; /* -- cgit v1.2.3