[IPoIB] Fix NDIS WHQL 1c_LoopbackSend test failures.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 28 Feb 2006 19:11:44 +0000 (19:11 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 28 Feb 2006 19:11:44 +0000 (19:11 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@224 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib/kernel/ipoib_port.c

index 62a2fb2..11743a9 100644 (file)
@@ -1791,18 +1791,21 @@ __recv_mgr_filter(
                p_eth = &p_desc->p_buf->eth.pkt;\r
 #endif /*IPOIB_INLINE_RECV */\r
 \r
-               /* Don't report loopback traffic - we requested SW loopback. */\r
-               if( !cl_memcmp( &p_port->p_adapter->mac, &p_eth->hdr.src,\r
-                       sizeof(p_port->p_adapter->mac) ) )\r
+               if( p_src )\r
                {\r
-                       /*\r
-                        * "This is not the packet you're looking for" - don't update\r
-                        * receive statistics, the packet never happened.\r
-                        */\r
-                       cl_qlist_insert_tail( p_bad_list, &p_desc->item.list_item );\r
-                       /* Dereference the port object on behalf of the failed receive. */\r
-                       cl_obj_deref( &p_port->obj );\r
-                       continue;\r
+                       /* Don't report loopback traffic - we requested SW loopback. */\r
+                       if( !cl_memcmp( &p_port->p_adapter->mac, &p_src->mac,\r
+                               sizeof(p_port->p_adapter->mac) ) )\r
+                       {\r
+                               /*\r
+                                * "This is not the packet you're looking for" - don't update\r
+                                * receive statistics, the packet never happened.\r
+                                */\r
+                               cl_qlist_insert_tail( p_bad_list, &p_desc->item.list_item );\r
+                               /* Dereference the port object on behalf of the failed recv. */\r
+                               cl_obj_deref( &p_port->obj );\r
+                               continue;\r
+                       }\r
                }\r
 \r
                switch( p_ipoib->hdr.type )\r
@@ -3971,6 +3974,14 @@ __endpt_mgr_ref(
 \r
        IPOIB_ENTER( IPOIB_DBG_ENDPT );\r
 \r
+       if( !cl_memcmp( &mac, &p_port->p_adapter->mac, sizeof(mac) ) )\r
+       {\r
+               /* Discard loopback traffic. */\r
+               IPOIB_TRACE( IPOIB_DBG_WARN, ("Discarding loopback traffic\n") );\r
+               IPOIB_EXIT( IPOIB_DBG_ENDPT );\r
+               return NDIS_STATUS_NO_ROUTE_TO_DESTINATION;\r
+       }\r
+\r
        key = 0;\r
        cl_memcpy( &key, &mac, sizeof(mac_addr_t) );\r
 \r