[ofw] [PATCH 2/2] IPoIB PXE boot support: Don't truncate DHCPoptions
Tzachi Dar
tzachid at mellanox.co.il
Sun Jun 28 03:11:02 PDT 2009
Applied on 2274.
Thanks
Tzachi
> -----Original Message-----
> From: ofw-bounces at lists.openfabrics.org
> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Fab Tillier
> Sent: Wednesday, May 27, 2009 8:05 PM
> To: ofw at lists.openfabrics.org
> Subject: [ofw] [PATCH 2/2] IPoIB PXE boot support: Don't
> truncate DHCPoptions
>
> 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;
>
More information about the ofw
mailing list