<!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 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>