From 59ea1a1ce7e1631c712fb09aff149f6b786392f8 Mon Sep 17 00:00:00 2001 From: ftillier Date: Mon, 11 Sep 2006 17:11:46 +0000 Subject: [PATCH] [IBAL] ib_modify_ca: trap invalid capability modifications. Initially submitted by Leonid Keller (leonid@mellanox.co.il), with changes by Fab Tillier (ftillier@silverstorm.com) git-svn-id: svn://openib.tc.cornell.edu/gen1@490 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/core/al/al_ca.c | 2 +- trunk/inc/iba/ib_types.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/trunk/core/al/al_ca.c b/trunk/core/al/al_ca.c index efc3445e..9bfe173f 100644 --- a/trunk/core/al/al_ca.c +++ b/trunk/core/al/al_ca.c @@ -300,7 +300,7 @@ ib_modify_ca( AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CA_HANDLE\n") ); return IB_INVALID_CA_HANDLE; } - if( !p_port_attr_mod ) + if( !p_port_attr_mod || (ca_mod & IB_CA_MOD_RESERVED_MASK) ) { AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") ); return IB_INVALID_PARAMETER; diff --git a/trunk/inc/iba/ib_types.h b/trunk/inc/iba/ib_types.h index a23d7dc9..55ecc808 100644 --- a/trunk/inc/iba/ib_types.h +++ b/trunk/inc/iba/ib_types.h @@ -9462,7 +9462,8 @@ typedef uint32_t ib_ca_mod_t; #define IB_CA_MOD_SHUTDOWN_PORT 0x00100000 #define IB_CA_MOD_INIT_TYPE_VALUE 0x00200000 #define IB_CA_MOD_SYSTEM_IMAGE_GUID 0x00400000 -#define IB_CA_MOD_IS_CLIENT_REREGISTER_SUPPORTED 0x00800000 +#define IB_CA_MOD_IS_CLIENT_REREGISTER_SUPPORTED 0x00800000 +#define IB_CA_MOD_RESERVED_MASK 0xFF000000 /* * VALUES * IB_CA_MOD_IS_CM_SUPPORTED @@ -9545,6 +9546,9 @@ typedef uint32_t ib_ca_mod_t; * IB_CA_MOD_IS_CLIENT_REREGISTER_SUPPORTED * Used to modify the system image GUID for the port. * +* IB_CA_MOD_RESERVED_MASK +* Mask of all the reserved bits. If any of these bits are set +* ib_modify_ca will return IB_INVALID_PARAMETER. *****/ -- 2.41.0