[Openib-windows] a sanity check for Modify CA verb

Leonid Keller leonid at mellanox.co.il
Mon Sep 11 07:57:07 PDT 2006


A little patch, adding a sanity check for Modify CA verb
 
Index: core/al/al_ca.c
===================================================================
--- core/al/al_ca.c (revision 487)
+++ core/al/al_ca.c (working copy)
@@ -305,6 +305,11 @@
   AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,
("IB_INVALID_PARAMETER\n") );
   return IB_INVALID_PARAMETER;
  }
+ if (ca_mod > IB_CA_MOD_LAST_OPTION)
+ {
+  AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,
("IB_INVALID_PARAMETER\n") );
+  return IB_INVALID_PARAMETER;
+ }
 
  status = verbs_modify_ca(h_ca, port_num, ca_mod, p_port_attr_mod);
 
Index: inc/iba/ib_types.h
===================================================================
--- inc/iba/ib_types.h (revision 487)
+++ inc/iba/ib_types.h (working copy)
@@ -9463,6 +9463,7 @@
 #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_LAST_OPTION    0x00800000
 /*
 * VALUES
 * IB_CA_MOD_IS_CM_SUPPORTED

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060911/464eb03b/attachment.html>


More information about the ofw mailing list