[ipoib] Allow dhcp to work also when the guids are not matched by the GUID to Mac...
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 8 Mar 2009 12:00:10 +0000 (12:00 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 8 Mar 2009 12:00:10 +0000 (12:00 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2018 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib/kernel/ipoib_port.c

index 1fd17ec..e6ff7c8 100644 (file)
@@ -2219,7 +2219,6 @@ __recv_dhcp(
        dhcp_pkt_t                      *p_dhcp;\r
        uint8_t                         *p_option;\r
        uint8_t                         *p_cid = NULL;\r
-       ib_gid_t                        gid;\r
        uint8_t                         msg = 0;\r
 \r
        IPOIB_ENTER( IPOIB_DBG_RECV );\r
@@ -2340,18 +2339,14 @@ __recv_dhcp(
                 * accesses to the contents.\r
                 * Recover CID to standard type.\r
                 */\r
-               cl_memcpy( &gid, &p_cid[7], sizeof(ib_gid_t) );\r
-               p_cid[1] =  HW_ADDR_LEN +1;// CID length \r
-               p_cid[2] =  DHCP_HW_TYPE_ETH;// CID type \r
-               status = ipoib_mac_from_guid( gid.unicast.interface_id, p_port->p_adapter->params.guid_mask, (mac_addr_t*)&p_cid[3] );\r
-               if (status == IB_INVALID_GUID_MASK)\r
-               {\r
-                       IPOIB_PRINT( TRACE_LEVEL_WARNING, IPOIB_DBG_ERROR,\r
-                               ("Invalid GUID mask received, rejecting it") );\r
-                       ipoib_create_log(p_port->p_adapter->h_adapter, GUID_MASK_LOG_INDEX, EVENT_IPOIB_WRONG_PARAMETER_WRN);\r
-                       status = IB_SUCCESS;\r
-               }\r
-               p_cid[HW_ADDR_LEN + 3] = DHCP_OPT_END; //terminate tag\r
+\r
+               CL_ASSERT(sizeof(ib_net64_t) == 8);\r
+\r
+               p_cid[1] =  sizeof (ib_net64_t) + 1;// CID length \r
+               p_cid[2] =  DHCP_HW_TYPE_ETH;// CID type\r
+               RtlMoveMemory( &p_cid[3], &p_cid[15], sizeof (ib_net64_t) );\r
+               RtlFillMemory(&p_cid[11], 12, 0);\r
+               p_cid[sizeof (ib_net64_t) + 3] = DHCP_OPT_END; //terminate tag \r
        }\r
        IPOIB_EXIT( IPOIB_DBG_RECV );\r
        return status;\r
@@ -3613,6 +3608,7 @@ __send_mgr_filter_dhcp(
                        }\r
                        else\r
                        {\r
+                               ASSERT(FALSE); // Do we ever reach here? does it work correct?\r
                                p_cid[2] = DHCP_HW_TYPE_IB;\r
                        }\r
                }\r