[ipoib] Fix mcast send for 2008.
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 16 Oct 2008 16:55:40 +0000 (16:55 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 16 Oct 2008 16:55:40 +0000 (16:55 +0000)
Signed off by: slavas@voltaire.com

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

ulp/ipoib/kernel/ipoib_port.c

index d0944bb..11ac13d 100644 (file)
@@ -4075,20 +4075,28 @@ ipoib_port_send(
                        UINT                            ip_hdr_buf_len;\r
 \r
                        // Extract the ip hdr \r
-                       NdisGetNextBuffer( p_buf, &p_ip_hdr_buf );\r
-                       if( !p_ip_hdr_buf )\r
+                       if(buf_len >= sizeof(ip_hdr_t)+ sizeof(eth_hdr_t))\r
                        {\r
-                               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
-                                       ("Failed to get IP header buffer.\n") );\r
-                               goto h_end;\r
+                               p_ip_hdr = (ip_hdr_t*)(p_eth_hdr + 1);\r
+                               ip_hdr_buf_len = sizeof(ip_hdr_t);\r
                        }\r
-       \r
-                       NdisQueryBufferSafe( p_ip_hdr_buf, &p_ip_hdr, &ip_hdr_buf_len, NormalPagePriority );\r
-                       if( !p_ip_hdr )\r
+                       else\r
                        {\r
-                               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
-                                       ("Failed to query IP header buffer.\n") );\r
-                               goto h_end;\r
+                               NdisGetNextBuffer( p_buf, &p_ip_hdr_buf );\r
+                               if( !p_ip_hdr_buf )\r
+                               {\r
+                                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                                               ("Failed to get IP header buffer.\n") );\r
+                                       goto h_end;\r
+                               }\r
+               \r
+                               NdisQueryBufferSafe( p_ip_hdr_buf, &p_ip_hdr, &ip_hdr_buf_len, NormalPagePriority );\r
+                               if( !p_ip_hdr )\r
+                               {\r
+                                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                                               ("Failed to query IP header buffer.\n") );\r
+                                       goto h_end;\r
+                               }\r
                        }\r
 \r
                        if( ip_hdr_buf_len < sizeof(ip_hdr_t) )\r