This is useful for testing applications that send those kind of MADS.

Signed-off-by: Sebastien Dugue <[email protected]>
---
 ibsim/sim_mad.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/ibsim/sim_mad.c b/ibsim/sim_mad.c
index 61d4866..b79a5e7 100644
--- a/ibsim/sim_mad.c
+++ b/ibsim/sim_mad.c
@@ -1170,6 +1170,25 @@ int process_packet(Client * cl, void *p, int size, 
Client ** dcl)
        if ((response = decode_sim_MAD(cl, r, &rpc, &path, data)) < 0)
                return -1;
 
+       /* Drop vendor MADs */
+       if (((rpc.mgtclass >= IB_VENDOR_RANGE1_START_CLASS) &&
+            (rpc.mgtclass <= IB_VENDOR_RANGE1_END_CLASS)) ||
+           ((rpc.mgtclass >= IB_VENDOR_RANGE2_START_CLASS) &&
+            (rpc.mgtclass <= IB_VENDOR_RANGE2_END_CLASS))) {
+               IBWARN("ignoring vendor MAD: class 0x%x, attr 0x%x",
+                      rpc.mgtclass, rpc.attr.id);
+               goto _dropped;
+       }
+
+       /* Drop vendor specific SM MADs */
+       if (((rpc.mgtclass == IB_SMI_CLASS) ||
+            (rpc.mgtclass == IB_SMI_DIRECT_CLASS)) &&
+           (rpc.attr.id >= 0xff00)) {
+               IBWARN("ignoring vendor specific SM MAD: attr 0x%x",
+                      rpc.attr.id);
+               goto _dropped;
+       }
+
        if (rpc.method == 0x7) {
                IBWARN("lid %u got trap repress - dropping", ntohs(r->dlid));
                *dcl = 0;
-- 
1.6.3.1

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to