[ofw] [PATCH 2/2] IPoIB PXE boot support: Don't truncate DHCP options

Fab Tillier ftillier at windows.microsoft.com
Wed May 27 10:05:16 PDT 2009


The original code would 'fix up' the CID in DHCP requests received by terminating the DHCP options after the CID was fixed up.  This worked as long as the CID was the last option, but the PXE ROM for the Mellanox HCAs does not put the CID at the end.  Thus, the existing code truncates the options, resulting in an incomplete DHCP request.  The patch fills the extra bytes in the CID area with the DHCP PAD option in order to preserve any subsequent options.

Note that this patch also fills in the hardware address in the DHCP request based on the source address of the packet.

Signed-off-by: Fab Tillier <ftillier at microsoft.com>

Index: ulp/ipoib/kernel/ipoib_port.c
===================================================================
--- ulp/ipoib/kernel/ipoib_port.c	(revision 2205)
+++ ulp/ipoib/kernel/ipoib_port.c	(working copy)
@@ -2339,14 +2343,12 @@ __recv_dhcp(
 		 * accesses to the contents.
 		 * Recover CID to standard type.
 		 */
-
-		CL_ASSERT(sizeof(ib_net64_t) == 8);
-
 		p_cid[1] =  sizeof (ib_net64_t) + 1;// CID length 
 		p_cid[2] =  DHCP_HW_TYPE_ETH;// CID type
 		RtlMoveMemory( &p_cid[3], &p_cid[15], sizeof (ib_net64_t) );
 		RtlFillMemory(&p_cid[11], 12, 0);
-		p_cid[sizeof (ib_net64_t) + 3] = DHCP_OPT_END; //terminate tag 
+
+		RtlCopyMemory( p_dhcp->chaddr, &p_src->mac, sizeof(p_src->mac) );
 	}
 	IPOIB_EXIT( IPOIB_DBG_RECV );
 	return status;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipoib_pxe2.patch
Type: application/octet-stream
Size: 770 bytes
Desc: ipoib_pxe2.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090527/3bf8c596/attachment.obj>


More information about the ofw mailing list