[IPoIB_NDIS6_CM] fix the wrong length calculation of
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 5 Jan 2010 18:51:23 +0000 (18:51 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 5 Jan 2010 18:51:23 +0000 (18:51 +0000)
first MDL within Net Buffer object.
The actual length of first MDL should be incremented by it's offset
signed-off by: Alexander Naslednikov (xalex at mellanox.co.il)

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2651 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp

index 641c094..ee60eed 100644 (file)
@@ -3513,6 +3513,9 @@ __send_mgr_get_eth_hdr(
                return NDIS_STATUS_FAILURE;\r
        }\r
 \r
+       ULONG MdlDataOffset = NET_BUFFER_CURRENT_MDL_OFFSET(p_net_buffer);\r
+       *p_mdl_len -= MdlDataOffset;\r
\r
        if( *p_mdl_len < sizeof(eth_hdr_t) )\r
        {\r
                IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
@@ -3521,7 +3524,7 @@ __send_mgr_get_eth_hdr(
                return NDIS_STATUS_BUFFER_TOO_SHORT;\r
        }\r
 \r
-       *pp_eth_hdr = (eth_hdr_t*)(p_head + NET_BUFFER_CURRENT_MDL_OFFSET(p_net_buffer));\r
+       *pp_eth_hdr = (eth_hdr_t*)(p_head + MdlDataOffset);\r
 \r
        IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND,\r
                ("Ethernet header:\n"\r