<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18876"></HEAD>
<BODY>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=553493012-30082010>The
DHCP interop patch again</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=553493012-30082010></SPAN></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2>Index:
inc/kernel/ip_packet.h<BR>===================================================================<BR>---
inc/kernel/ip_packet.h (revision 6071)<BR>+++
inc/kernel/ip_packet.h (working copy)<BR>@@ -461,6 +461,30 @@<BR> /*
Minimum DHCP size is without options (but with 4-byte magic cookie).
*/<BR> #define DHCP_MIN_SIZE (sizeof(dhcp_pkt_t) +
DHCP_COOKIE_SIZE - DHCP_OPTIONS_SIZE )<BR> <BR>+// The length of IPoIB data
inside CID field of DHCP packets<BR>+static const uint8_t coIPoIB_CID_Len =
20;<BR>+static const uint8_t coIPoIB_CID_TotalLen = 22;<BR>+<BR>+<BR>+//static
const uint8_t coIPoIB_HwTypeIB = 0xFF; - This definition will not work for
C-code (C- C2099)<BR>+#define coIPoIB_HwTypeIB 0xFF<BR>+<BR>+// The default
prefix of IPoIB CID field within CID.<BR>+static const uint8_t
coIBDefaultDHCPPrefix[] = {<BR>+ coIPoIB_HwTypeIB, 0x0, 0x0,
0x0,<BR>+ 0x0, 0x0, 0x2, 0x0,<BR>+ 0x0, 0x2, 0xc,
0x0<BR>+};<BR>+<BR>+/* The CID will contain of: <BR>+ CID[0] =
DHCP_OPT_CLIENT_ID;<BR>+ CID[1] = coIPoIB_CID_Len;<BR>+ CID[2:13] =
coIBDefaultDHCPPrefix; (Here CID[2] always ==
coIPoIB_HwTypeIB)<BR>+ CID[14:21] =
GUID;<BR>+*/<BR>+<BR>+<BR>+<BR> #include
<complib/cl_packon.h><BR> /****s* IB Network
Drivers/dhcp_pkt_t<BR> * NAME<BR>Index:
ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp<BR>===================================================================<BR>---
ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp (revision 6071)<BR>+++
ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp (working copy)<BR>@@ -2727,16
+2727,22 @@<BR> if( p_cid ) /* from client
*/<BR> {<BR> /* Validate that the length and type of
the option is as required. */<BR>- if( p_cid[1] != 21
)<BR>+ IPOIB_PRINT(TRACE_LEVEL_VERBOSE,
IPOIB_DBG_RECV,<BR>+ ("DHCP CID received
is:"));<BR>+ for (int i=0; i < coIPoIB_CID_TotalLen; ++i)
{<BR>+ IPOIB_PRINT(TRACE_LEVEL_VERBOSE,
IPOIB_DBG_RECV,<BR>+ ("[%d] 0x%x: \n",i,
p_cid[i]));<BR>+ }<BR>+ if( p_cid[1] != coIPoIB_CID_Len
)<BR> {<BR> IPOIB_PRINT_EXIT(
TRACE_LEVEL_ERROR,
IPOIB_DBG_ERROR,<BR>- ("Client-identifier length not 21
as required.\n") );<BR>+ ("Client-identifier length is
not equal to %d as required.\n",coIPoIB_CID_Len)
);<BR> return
IB_INVALID_SETTING;<BR> }<BR>- if( p_cid[2] !=
DHCP_HW_TYPE_IB )<BR>+ if( p_cid[2] !=
coIPoIB_HwTypeIB)<BR> {<BR> IPOIB_PRINT_EXIT(
TRACE_LEVEL_ERROR,
IPOIB_DBG_ERROR,<BR>- ("Client-identifier type is
wrong.\n") );<BR>+ ("Client-identifier type is %d
<> %d and wrong \n", p_cid[2], coIPoIB_HwTypeIB)
);<BR> return
IB_INVALID_SETTING;<BR> }<BR> /*<BR>@@ -2746,8
+2752,10 @@<BR> */<BR> p_cid[1] =
sizeof (ib_net64_t) + 1;// CID length <BR> p_cid[2] =
DHCP_HW_TYPE_ETH;// CID type<BR>- RtlMoveMemory( &p_cid[3],
&p_cid[15], sizeof (ib_net64_t)
);<BR>- RtlFillMemory(&p_cid[11], 12, 0);<BR>+ //Copy
the GUID to the 3-d byte of CID<BR>+ RtlMoveMemory( &p_cid[3],
&p_cid[coIPoIB_CID_TotalLen - sizeof (ib_net64_t)], sizeof (ib_net64_t)
);<BR>+ // Clear the
rest<BR>+ RtlFillMemory(&p_cid[3+sizeof
(ib_net64_t)],coIPoIB_CID_TotalLen - 3 -sizeof (ib_net64_t),
0);<BR> <BR> RtlCopyMemory( p_dhcp->chaddr,
&p_src->mac, sizeof(p_src->mac) );<BR> RtlFillMemory(
&p_dhcp->chaddr[sizeof(p_src->mac)],<BR>@@ -4512,7 +4520,6
@@<BR> uint8_t *p_option, *p_cid =
NULL;<BR> uint8_t msg =
0;<BR> size_t len;<BR>- ib_gid_t gid;<BR> <BR> IPOIB_ENTER(
IPOIB_DBG_SEND );<BR> <BR>@@ -4624,10 +4631,11
@@<BR> if( p_cid[1] == HW_ADDR_LEN+1 &&
!cl_memcmp(
&p_cid[3],<BR> &s_buf->p_port->p_adapter->params.conf_mac.addr,
HW_ADDR_LEN ) )<BR> {<BR>- /* Make
sure there's room to extend it. 23 is the size
of<BR>- * the CID option for
IPoIB.<BR>+ ASSERT( FALSE
);<BR>+ /* Make sure there's room to extend it. 22
is the size of<BR>+ * the CID option for IPoIB. (20 is
the length, one byte for type and the second for lenght
field)<BR> */<BR>- if(
buf_len + 23 - p_cid[1] > sizeof(dhcp_pkt_t)
)<BR>+ if( buf_len + coIPoIB_CID_TotalLen - p_cid[1] >
sizeof(dhcp_pkt_t)
)<BR> {<BR> IPOIB_PRINT_EXIT(
TRACE_LEVEL_ERROR,
IPOIB_DBG_ERROR,<BR> ("Can't convert
CID to IPoIB format.\n") );<BR>@@ -4640,13 +4648,8
@@<BR> <BR> p_cid +=
len;<BR> p_cid[0] =
DHCP_OPT_CLIENT_ID;<BR>- p_cid[1] =
21;<BR>- p_cid[2] =
DHCP_HW_TYPE_IB;<BR>+ p_cid[1] =
coIPoIB_CID_Len;<BR> }<BR>- else<BR>- {<BR>- p_cid[2]
=
DHCP_HW_TYPE_IB;<BR>- }<BR> }<BR> else<BR> {<BR>@@
-4654,7 +4657,7 @@<BR> * Make sure there's room to
extend it. 23 is the size of<BR> * the CID option
for IPoIB.<BR> */<BR>- if( buf_len + 23
> sizeof(dhcp_pkt_t) )<BR>+ if( buf_len +
coIPoIB_CID_TotalLen > sizeof(dhcp_pkt_t)
)<BR> {<BR> IPOIB_PRINT_EXIT(
TRACE_LEVEL_ERROR,
IPOIB_DBG_ERROR,<BR> ("Can't convert CID to
IPoIB format.\n") );<BR>@@ -4662,34 +4665,27
@@<BR> }<BR> <BR> p_cid =
p_option;<BR>- p_option = p_cid +
23;<BR>- p_option[0] =
DHCP_OPT_END;<BR> p_cid[0] =
DHCP_OPT_CLIENT_ID;<BR>- p_cid[1] =
21;<BR>- p_cid[2] =
DHCP_HW_TYPE_IB;<BR>+ p_cid[1] =
coIPoIB_CID_Len;<BR> }<BR> <BR>- CL_ASSERT(
p_cid[1] == 21 );<BR>- p_cid[23]=
DHCP_OPT_END;<BR>- ib_gid_set_default( &gid,
s_buf->p_port->p_adapter->guids.port_guid.guid
);<BR>- cl_memcpy( &p_cid[7], &gid, sizeof(ib_gid_t)
);<BR>- cl_memcpy( &p_cid[3],
&s_buf->p_port->ib_mgr.qpn, sizeof(s_buf->p_port->ib_mgr.qpn)
); <BR>+ CL_ASSERT( p_cid[1] ==
coIPoIB_CID_Len);<BR>+ p_cid[coIPoIB_CID_TotalLen]=
DHCP_OPT_END;<BR>+ <BR>+ // Copy the default prefix for
ALL DHCP messages<BR>+ cl_memcpy( &p_cid[2],
&coIBDefaultDHCPPrefix[0], sizeof coIBDefaultDHCPPrefix);<BR>+ //
Copy the GUID into the last 8 bytes of the CID field<BR>+ cl_memcpy(
&p_cid[2+
sizeof(coIBDefaultDHCPPrefix)],&s_buf->p_port->p_adapter->guids.port_guid.guid
,
<BR>+ sizeof(s_buf->p_port->p_adapter->guids.port_guid.guid)
);<BR>+ <BR> p_ib_dhcp->htype =
DHCP_HW_TYPE_IB;<BR> <BR>- /* update lengths to include any
change we made */<BR>- s_buf->p_send_buf->ip.hdr.length =
cl_ntoh16( sizeof(ip_hdr_t) + sizeof(udp_hdr_t) + sizeof(dhcp_pkt_t)
);<BR>- s_buf->p_send_buf->ip.prot.udp.hdr.length = cl_ntoh16(
sizeof(udp_hdr_t) + sizeof(dhcp_pkt_t) );<BR>-<BR>- /* update crc in
ip header */<BR>- //if(
!p_port->p_adapter->params.send_chksum_offload )<BR>- //{
//TODO ?<BR>- s_buf->p_send_buf->ip.hdr.chksum =
0;<BR>- s_buf->p_send_buf->ip.hdr.chksum = ipchksum((unsigned
short*) &s_buf->p_send_buf->ip.hdr,
sizeof(ip_hdr_t));<BR>- //} TODO
??<BR> break;<BR> <BR> /* Server messages.
*/<BR> case DHCPOFFER:<BR>+ p_ib_dhcp->htype =
0x20;<BR>+ p_ib_dhcp->hlen = 0x8;<BR> case
DHCPACK:<BR> case DHCPNAK:<BR> /* don't touch server
messages */<BR>@@ -4700,7 +4696,14 @@<BR> ("Invalide
message type.\n") );<BR> return
NDIS_STATUS_INVALID_DATA;<BR> }<BR>- /* no chksum for udp
*/<BR>+<BR>+ s_buf->p_send_buf->ip.hdr.length = cl_ntoh16(
sizeof(ip_hdr_t) + sizeof(udp_hdr_t) + sizeof(dhcp_pkt_t)
);<BR>+ s_buf->p_send_buf->ip.prot.udp.hdr.length = cl_ntoh16(
sizeof(udp_hdr_t) + sizeof(dhcp_pkt_t)
);<BR>+ s_buf->p_send_buf->ip.hdr.chksum =
0;<BR>+ s_buf->p_send_buf->ip.hdr.chksum = ipchksum((unsigned short*)
&s_buf->p_send_buf->ip.hdr,
sizeof(ip_hdr_t));<BR>+<BR>+ <BR>+ /* no chksum for udp, in a case
when HW does not support checksum offload
*/<BR> s_buf->p_send_buf->ip.prot.udp.hdr.chksum =
0;<BR> p_desc->send_wr[0].local_ds[1].vaddr = cl_get_physaddr(
s_buf->p_send_buf );<BR> p_desc->send_wr[0].local_ds[1].length
= sizeof(ip_hdr_t) + sizeof(udp_hdr_t) +
sizeof(dhcp_pkt_t);<BR></DIV></FONT></FONT></FONT><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Alex Naslednikov <BR><B>Sent:</B> Sunday,
August 29, 2010 8:38 AM<BR><B>To:</B> 'Smith, Stan'; Tzachi Dar; Uri
Habusha<BR><B>Cc:</B> ofw@lists.openfabrics.org<BR><B>Subject:</B> RE:
[ofw][patch][IPoIB_NDIS6_CM] DHCP fix- Linux interop <BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=556333505-29082010><FONT color=#0000ff size=2 face=Arial>I was
surprised to find that this patch was never applied.</FONT></SPAN></DIV>
<DIV><SPAN class=556333505-29082010><FONT color=#0000ff size=2 face=Arial>It was
another functionality patch, but it is not related to this
one.</FONT></SPAN></DIV>
<DIV><SPAN class=556333505-29082010><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=556333505-29082010><FONT color=#0000ff size=2 face=Arial>I will
resend the patch attached below</FONT></SPAN></DIV>
<DIV><SPAN class=556333505-29082010><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=556333505-29082010><FONT color=#0000ff size=2
face=Arial>XaleX</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Smith, Stan [mailto:stan.smith@intel.com]
<BR><B>Sent:</B> Friday, August 27, 2010 8:01 PM<BR><B>To:</B> Alex Naslednikov;
Tzachi Dar; Uri Habusha<BR><B>Cc:</B>
ofw@lists.openfabrics.org<BR><B>Subject:</B> RE: [ofw][patch][IPoIB_NDIS6_CM]
DHCP fix- Linux interop <BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial>Gentlemen,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial> The DHCP patch for Linux interop was never applied to
OpenIB SVN tree?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial>The patch you supplied did not apply cleanly, nor was it
complete; did not compile.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial>Missing definitions for</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial>coIPoIB_CID_TotalLen</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial>coIPoIB_CID_Len</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial><BR>coIPoIB_HwTypeIB</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial>coIBDefaultDHCPPrefix </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial>Please advise.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial>Given the major mismatches experiences I've had of late
between OpenIB SVN tree (ipoib_ndis6_cm) and your internal tree, would you
please send me your ipoib_NDIS6_CM\ipoib_port.cpp file so I can verify the hand
patching I've done (Uri's & your patches) plus attempt to update the SVN
copy to closer match what you have (at times the patch fuzz is over 200
lines).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial>thanks,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=437004916-27082010><FONT color=#0000ff
size=2 face=Arial>stan.</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Alex Naslednikov
[mailto:xalex@mellanox.co.il] <BR><B>Sent:</B> Thursday, August 26, 2010 6:53
AM<BR><B>To:</B> ofw@lists.openfabrics.org; Smith, Stan<BR><B>Subject:</B>
[ofw][patch][IPoIB_NDIS6_CM] DHCP fix- Linux interop <BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT size=2 face=Arial>The format of Client Identifier Field (CID) was
changed.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>/* The CID will contain of: <BR> CID[0] =
DHCP_OPT_CLIENT_ID == 61<BR> CID[1] = coIPoIB_CID_Len ==
22<BR> CID[2:13] = coIBDefaultDHCPPrefix; (Here CID[2] always ==
coIPoIB_HwTypeIB == 0xFF)<BR> CID[14:21] = GUID;<BR>*/<BR>Signed-off by:
Alexander Naslednikov (xalex at mellanox.co.il)<BR>Index:
B:/users/xalex/MLNX_WinOF-2_1_2/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp<BR>===================================================================<BR>---
B:/users/xalex/MLNX_WinOF-2_1_2/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp (revision
6117)<BR>+++
B:/users/xalex/MLNX_WinOF-2_1_2/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp (revision
6118)<BR>@@ -2727,16 +2727,22 @@<BR> if( p_cid ) /* from client
*/<BR> {<BR> /* Validate that the length and type of
the option is as required. */<BR>- if( p_cid[1] != 21
)<BR>+ IPOIB_PRINT(TRACE_LEVEL_VERBOSE,
IPOIB_DBG_RECV,<BR>+ ("DHCP CID received
is:"));<BR>+ for (int i=0; i < coIPoIB_CID_TotalLen; ++i)
{<BR>+ IPOIB_PRINT(TRACE_LEVEL_VERBOSE,
IPOIB_DBG_RECV,<BR>+ ("[%d] 0x%x: \n",i,
p_cid[i]));<BR>+ }<BR>+ if( p_cid[1] != coIPoIB_CID_Len
)<BR> {<BR> IPOIB_PRINT_EXIT(
TRACE_LEVEL_ERROR,
IPOIB_DBG_ERROR,<BR>- ("Client-identifier length not 21
as required.\n") );<BR>+ ("Client-identifier length is
not equal to %d as required.\n",coIPoIB_CID_Len)
);<BR> return
IB_INVALID_SETTING;<BR> }<BR>- if( p_cid[2] !=
DHCP_HW_TYPE_IB )<BR>+ if( p_cid[2] !=
coIPoIB_HwTypeIB)<BR> {<BR> IPOIB_PRINT_EXIT(
TRACE_LEVEL_ERROR,
IPOIB_DBG_ERROR,<BR>- ("Client-identifier type is
wrong.\n") );<BR>+ ("Client-identifier type is %d
<> %d and wrong \n", p_cid[2], coIPoIB_HwTypeIB)
);<BR> return
IB_INVALID_SETTING;<BR> }<BR> /*<BR>@@ -2746,8
+2752,10 @@<BR> */<BR> p_cid[1] =
sizeof (ib_net64_t) + 1;// CID length <BR> p_cid[2] =
DHCP_HW_TYPE_ETH;// CID type<BR>- RtlMoveMemory( &p_cid[3],
&p_cid[15], sizeof (ib_net64_t)
);<BR>- RtlFillMemory(&p_cid[11], 12, 0);<BR>+ //Copy
the GUID to the 3-d byte of CID<BR>+ RtlMoveMemory( &p_cid[3],
&p_cid[coIPoIB_CID_TotalLen - sizeof (ib_net64_t)], sizeof (ib_net64_t)
);<BR>+ // Clear the
rest<BR>+ RtlFillMemory(&p_cid[3+sizeof
(ib_net64_t)],coIPoIB_CID_TotalLen - 3 -sizeof (ib_net64_t),
0);<BR> <BR> RtlCopyMemory( p_dhcp->chaddr,
&p_src->mac, sizeof(p_src->mac) );<BR> RtlFillMemory(
&p_dhcp->chaddr[sizeof(p_src->mac)],<BR>@@ -4512,7 +4520,6
@@<BR> uint8_t *p_option, *p_cid =
NULL;<BR> uint8_t msg =
0;<BR> size_t len;<BR>- ib_gid_t gid;<BR> <BR> IPOIB_ENTER(
IPOIB_DBG_SEND );<BR> <BR>@@ -4624,10 +4631,11
@@<BR> if( p_cid[1] == HW_ADDR_LEN+1 &&
!cl_memcmp(
&p_cid[3],<BR> &s_buf->p_port->p_adapter->params.conf_mac.addr,
HW_ADDR_LEN ) )<BR> {<BR>- /* Make
sure there's room to extend it. 23 is the size
of<BR>- * the CID option for
IPoIB.<BR>+ ASSERT( FALSE
);<BR>+ /* Make sure there's room to extend it. 22
is the size of<BR>+ * the CID option for IPoIB. (20 is
the length, one byte for type and the second for lenght
field)<BR> */<BR>- if(
buf_len + 23 - p_cid[1] > sizeof(dhcp_pkt_t)
)<BR>+ if( buf_len + coIPoIB_CID_TotalLen - p_cid[1] >
sizeof(dhcp_pkt_t)
)<BR> {<BR> IPOIB_PRINT_EXIT(
TRACE_LEVEL_ERROR,
IPOIB_DBG_ERROR,<BR> ("Can't convert
CID to IPoIB format.\n") );<BR>@@ -4640,13 +4648,8
@@<BR> <BR> p_cid +=
len;<BR> p_cid[0] =
DHCP_OPT_CLIENT_ID;<BR>- p_cid[1] =
21;<BR>- p_cid[2] =
DHCP_HW_TYPE_IB;<BR>+ p_cid[1] =
coIPoIB_CID_Len;<BR> }<BR>- else<BR>- {<BR>- p_cid[2]
=
DHCP_HW_TYPE_IB;<BR>- }<BR> }<BR> else<BR> {<BR>@@
-4654,7 +4657,7 @@<BR> * Make sure there's room to
extend it. 23 is the size of<BR> * the CID option
for IPoIB.<BR> */<BR>- if( buf_len + 23
> sizeof(dhcp_pkt_t) )<BR>+ if( buf_len +
coIPoIB_CID_TotalLen > sizeof(dhcp_pkt_t)
)<BR> {<BR> IPOIB_PRINT_EXIT(
TRACE_LEVEL_ERROR,
IPOIB_DBG_ERROR,<BR> ("Can't convert CID to
IPoIB format.\n") );<BR>@@ -4662,18 +4665,19
@@<BR> }<BR> <BR> p_cid =
p_option;<BR>- p_option = p_cid +
23;<BR>- p_option[0] =
DHCP_OPT_END;<BR> p_cid[0] =
DHCP_OPT_CLIENT_ID;<BR>- p_cid[1] =
21;<BR>- p_cid[2] =
DHCP_HW_TYPE_IB;<BR>+ p_cid[1] =
coIPoIB_CID_Len;<BR> }<BR> <BR>- CL_ASSERT(
p_cid[1] == 21 );<BR>- p_cid[23]=
DHCP_OPT_END;<BR>- ib_gid_set_default( &gid,
s_buf->p_port->p_adapter->guids.port_guid.guid
);<BR>- cl_memcpy( &p_cid[7], &gid, sizeof(ib_gid_t)
);<BR>- cl_memcpy( &p_cid[3],
&s_buf->p_port->ib_mgr.qpn, sizeof(s_buf->p_port->ib_mgr.qpn)
); <BR>+ CL_ASSERT( p_cid[1] ==
coIPoIB_CID_Len);<BR>+ p_cid[coIPoIB_CID_TotalLen]=
DHCP_OPT_END;<BR>+ <BR>+ // Copy the default prefix for
ALL DHCP messages<BR>+ cl_memcpy( &p_cid[2],
&coIBDefaultDHCPPrefix[0], sizeof coIBDefaultDHCPPrefix);<BR>+ //
Copy the GUID into the last 8 bytes of the CID field<BR>+ cl_memcpy(
&p_cid[2+
sizeof(coIBDefaultDHCPPrefix)],&s_buf->p_port->p_adapter->guids.port_guid.guid
,
<BR>+ sizeof(s_buf->p_port->p_adapter->guids.port_guid.guid)
);<BR>+ <BR> p_ib_dhcp->htype =
DHCP_HW_TYPE_IB;<BR> <BR> /* update lengths to include any
change we made */<BR>@@ -4690,6 +4694,8 @@<BR> <BR> /* Server
messages. */<BR> case DHCPOFFER:<BR>+ p_ib_dhcp->htype
= 0x20;<BR>+ p_ib_dhcp->hlen = 0x8;<BR> case
DHCPACK:<BR> case DHCPNAK:<BR> /* don't touch server
messages */</FONT></DIV></BODY></HTML>