Changeset 8250503 in rtems for cpukit/librpc


Ignore:
Timestamp:
Apr 23, 2012, 12:42:58 PM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
87194f9, 97bda25
Parents:
6c18c97
git-author:
Sebastian Huber <sebastian.huber@…> (04/23/12 12:42:58)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/06/12 11:57:43)
Message:

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.

Location:
cpukit/librpc
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • cpukit/librpc/include/rpc/auth.h

    r6c18c97 r8250503  
    6868        */
    6969        AUTH_INVALIDRESP=6,             /* bogus response verifier */
    70         AUTH_FAILED=7                   /* some unknown reason */
     70        AUTH_FAILED=7,                  /* some unknown reason */
     71        _AUTH_STAT = 0xffffffff
    7172};
    7273
  • cpukit/librpc/include/rpc/clnt_stat.h

    r6c18c97 r8250503  
    7474        RPC_CANTCONNECT = 26,           /* couldn't make connection (cots) */
    7575        RPC_XPRTFAILED = 27,            /* received discon from remote (cots) */
    76         RPC_CANTCREATESTREAM = 28       /* can't push rpc module (cots) */
     76        RPC_CANTCREATESTREAM = 28,      /* can't push rpc module (cots) */
     77        _CLNT_STAT = 0xffffffff
    7778};
    7879
  • cpukit/librpc/include/rpc/rpc_msg.h

    r6c18c97 r8250503  
    5959enum msg_type {
    6060        CALL=0,
    61         REPLY=1
     61        REPLY=1,
     62        _MSG_TYPE = 0xffffffff
    6263};
    6364
    6465enum reply_stat {
    6566        MSG_ACCEPTED=0,
    66         MSG_DENIED=1
     67        MSG_DENIED=1,
     68        _REPLY_STAT = 0xffffffff
    6769};
    6870
     
    7375        PROC_UNAVAIL=3,
    7476        GARBAGE_ARGS=4,
    75         SYSTEM_ERR=5
     77        SYSTEM_ERR=5,
     78        _ACCEPT_STAT = 0xffffffff
    7679};
    7780
    7881enum reject_stat {
    7982        RPC_MISMATCH=0,
    80         AUTH_ERROR=1
     83        AUTH_ERROR=1,
     84        _REJECT_STAT = 0xffffffff
    8185};
    8286
  • cpukit/librpc/include/rpc/svc.h

    r6c18c97 r8250503  
    7373        XPRT_DIED,
    7474        XPRT_MOREREQS,
    75         XPRT_IDLE
     75        XPRT_IDLE,
     76        _XPRT_STAT = 0xffffffff
    7677};
    7778
  • cpukit/librpc/include/rpcsvc/nis_db.h

    r6c18c97 r8250503  
    7070        DB_MEMORY_LIMIT = 6,
    7171        DB_STORAGE_LIMIT = 7,
    72         DB_INTERNAL_ERROR = 8
     72        DB_INTERNAL_ERROR = 8,
     73        _DB_STATUS = 0xffffffff
    7374};
    7475typedef enum db_status db_status;
     
    8182        DB_NEXT = 4,
    8283        DB_ALL = 5,
    83         DB_RESET_NEXT = 6
     84        DB_RESET_NEXT = 6,
     85        _DB_ACTION = 0xffffffff
    8486};
    8587typedef enum db_action db_action;
  • cpukit/librpc/include/rpcsvc/yp_prot.h

    r6c18c97 r8250503  
    234234enum ypbind_resptype {
    235235        YPBIND_SUCC_VAL = 1,
    236         YPBIND_FAIL_VAL = 2
     236        YPBIND_FAIL_VAL = 2,
     237        _YPBIND_RESPTYPE = 0xffffffff
    237238};
    238239
  • cpukit/librpc/src/xdr/xdr.c

    r6c18c97 r8250503  
    459459{
    460460#ifndef lint
    461         enum sizecheck { SIZEVAL };     /* used to find the size of an enum */
    462 
    463461        /*
    464462         * enums are treated as ints
    465463         */
    466         if (sizeof (enum sizecheck) == sizeof (long)) {
     464        if (sizeof (enum_t) == sizeof (long)) {
    467465                return (xdr_long(xdrs, (long *)ep));
    468         } else if (sizeof (enum sizecheck) == sizeof (int)) {
     466        } else if (sizeof (enum_t) == sizeof (int)) {
    469467                return (xdr_int(xdrs, (int *)ep));
    470         } else if (sizeof (enum sizecheck) == sizeof (short)) {
     468        } else if (sizeof (enum_t) == sizeof (short)) {
    471469                return (xdr_short(xdrs, (short *)ep));
    472470        } else {
Note: See TracChangeset for help on using the changeset viewer.