From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from IMSVA.IN.MEGATRENDS.COM (venus.amiindia.co.in [111.93.197.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C71F81A1E4C for ; Tue, 6 Sep 2016 04:47:40 -0700 (PDT) Received: from IMSVA.IN.MEGATRENDS.COM (IMSVA.IN.MEGATRENDS.COM [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A867082047; Tue, 6 Sep 2016 17:17:51 +0530 (IST) Received: from IMSVA.IN.MEGATRENDS.COM (IMSVA.IN.MEGATRENDS.COM [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9190282046; Tue, 6 Sep 2016 17:17:51 +0530 (IST) Received: from webmail.amiindia.co.in (venus2.in.megatrends.com [10.0.0.7]) by IMSVA.IN.MEGATRENDS.COM (Postfix) with ESMTPS; Tue, 6 Sep 2016 17:17:51 +0530 (IST) Received: from VENUS1.in.megatrends.com ([fe80::951:7975:6ecf:eae5]) by Venus2.in.megatrends.com ([fe80::2002:4a07:4f17:c09b%14]) with mapi id 14.03.0248.002; Tue, 6 Sep 2016 17:17:35 +0530 From: Santhapur Naveen To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Fu, Siyuan" Thread-Topic: [edk2] [Patch] MdeModulePkg: Support classless IP for DHCPv4 TransmitReceive() Thread-Index: AQHR+RLwIH+7Fl9w206WgrYfZrCIQqBN2AGAgABcjqCAF5ss8IAGPxGAgABnebA= Date: Tue, 6 Sep 2016 11:47:35 +0000 Message-ID: <625A2455CC232F40B0F38F05ACED6D976C5497C8@VENUS1.in.megatrends.com> References: <1471498722-36656-1-git-send-email-jiaxin.wu@intel.com> <895558F6EA4E3B41AC93A00D163B7274137C87CB@SHSMSX103.ccr.corp.intel.com> <625A2455CC232F40B0F38F05ACED6D976C5472EB@VENUS1.in.megatrends.com> <895558F6EA4E3B41AC93A00D163B7274137FA5AF@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <895558F6EA4E3B41AC93A00D163B7274137FA5AF@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.93.16] MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1600-8.1.0.1054-22558.006 X-TM-AS-Result: No--31.808-5.0-31-10 X-imss-scan-details: No--31.808-5.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1600-8.1.1054-22558.006 X-TMASE-Result: 10--31.808400-10.000000 X-TMASE-MatchedRID: 6lay9u8oTUN5X0FJZbmEppmug812qIbz6GEC2UQpiEkutoY2UtFqGDc/ pey/d/oN45HLzdQc+37L02lIAv48JwDBaeVuVh0C8eSmTJSmEv2nHBIbyMjCFFuB5ItLuryETgp zWPQpDCXffQxPXzGm8Uv38wDcItJYr9Xz9yCPONJmVHNo7XGknQS7cfuuBhWpmLey3mPjJ/kfkv YaEFC1987DMbWn+qVQ7klVLUuseY+ROBVNmXUDuH4f9De+CyQCVBDQSDMig9EkKSeU/Y3qfEfl+ H4+MqTJxQtJY8XZ0lf4tntxJdec+LcH4/RZ7lQnxDtI40oHM25r9+Kgn2XgeGhOvGVMk60FR/gf 3nAKhpnOMJwkoUb+fTNhWKdTvq2AMjRTNF2tbaipuD25aEtgt/ioIsi7Sa0g51ONI4UL++qjxYy RBa/qJeGf7whhst7+t7DW3B48kkFJV3La6JhRYvoLR4+zsDTtAqYBE3k9Mpw= X-TMASE-SNAP-Result: 1.811037.0001-0-1-12:0,22:0,33:0,34:0,39:0-0 Subject: Re: [Patch] MdeModulePkg: Support classless IP for DHCPv4 TransmitReceive() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2016 11:47:41 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Jiaxin, Thank you very much for your timely help and support. Regards, Naveen -----Original Message----- From: Wu, Jiaxin [mailto:jiaxin.wu@intel.com]=20 Sent: Tuesday, September 06, 2016 4:35 PM To: Santhapur Naveen; edk2-devel@lists.01.org Cc: Ye, Ting; Fu, Siyuan Subject: RE: [edk2] [Patch] MdeModulePkg: Support classless IP for DHCPv4 T= ransmitReceive() Hi Naveen, The patch has been committed: SHA-1: 8c5f78a2cc15199e3f77ae4b156023af366fd6c7 * MdeModulePkg: Support classless IP for DHCPv4 TransmitReceive() Thanks, Jiaxin > -----Original Message----- > From: Santhapur Naveen [mailto:naveens@amiindia.co.in] > Sent: Friday, September 2, 2016 2:16 PM > To: Wu, Jiaxin ; edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan > Subject: RE: [edk2] [Patch] MdeModulePkg: Support classless IP for=20 > DHCPv4 > TransmitReceive() >=20 > Hello Jiaxin, >=20 > My sincere apologies for the delayed response. >=20 > I've verified the patch from my side and PXE boot is happening=20 > successfully even in classless IP network. >=20 > May I know whether this will be included in EDK2? If yes, can you=20 > please provide any schedule for the same? >=20 > Best regards, > Naveen >=20 > -----Original Message----- > From: Santhapur Naveen > Sent: Thursday, August 18, 2016 11:14 AM > To: 'Wu, Jiaxin'; edk2-devel@lists.01.org > Cc: Ye, Ting; Fu, Siyuan; Sivaraman Nainar; Madhan B. Santharam > Subject: RE: [edk2] [Patch] MdeModulePkg: Support classless IP for=20 > DHCPv4 > TransmitReceive() >=20 > Jiaxin, >=20 > We will verify the patch and update you the result. >=20 > Thanks, > Naveen >=20 > -----Original Message----- > From: Wu, Jiaxin [mailto:jiaxin.wu@intel.com] > Sent: Thursday, August 18, 2016 11:12 AM > To: Santhapur Naveen; Wu, Jiaxin; edk2-devel@lists.01.org > Cc: Ye, Ting; Fu, Siyuan; Sivaraman Nainar; Madhan B. Santharam > Subject: RE: [edk2] [Patch] MdeModulePkg: Support classless IP for=20 > DHCPv4 > TransmitReceive() >=20 > Naveen, >=20 > Can you help to verify this patch to support the classless IP. >=20 > Thanks, > Jiaxin >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf=20 > > Of Jiaxin Wu > > Sent: Thursday, August 18, 2016 1:39 PM > > To: edk2-devel@lists.01.org > > Cc: Ye, Ting ; Fu, Siyuan ;=20 > > Santhapur Naveen > > Subject: [edk2] [Patch] MdeModulePkg: Support classless IP for=20 > > DHCPv4 > > TransmitReceive() > > > > The IP address should not be treated as classful one if DHCP options=20 > > contain a classless IP with its true subnet mask. Otherwise, DHCPv4 > > TransmitReceive() will failed. This real subnet mask will be parsed=20 > > and recorded in DhcpSb->Netmask. So, we need check it before get the=20 > > IP's corresponding subnet mask. > > > > Cc: Santhapur Naveen > > Cc: Ye Ting > > Cc: Fu Siyuan > > Contributed-under: TianoCore Contribution Agreement 1.0 > > Signed-off-by: Jiaxin Wu > > --- > > .../Universal/Network/Dhcp4Dxe/Dhcp4Impl.c | 28 > +++++++++++++++- > > ------ > > 1 file changed, 20 insertions(+), 8 deletions(-) > > > > diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c > > b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c > > index 4f491b4..79f7cde 100644 > > --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c > > +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c > > @@ -1,9 +1,9 @@ > > /** @file > > This file implement the EFI_DHCP4_PROTOCOL interface. > > > > -Copyright (c) 2006 - 2015, Intel Corporation. All rights=20 > > reserved.
> > +Copyright (c) 2006 - 2016, Intel Corporation. All rights=20 > > +reserved.
> > This program and the accompanying materials are licensed and made=20 > > available under the terms and conditions of the BSD License which=20 > > accompanies this distribution. The full text of the license may be=20 > > found at http://opensource.org/licenses/bsd-license.php > > > > @@ -1186,18 +1186,20 @@ Dhcp4InstanceConfigUdpIo ( > > IN UDP_IO *UdpIo, > > IN VOID *Context > > ) > > { > > DHCP_PROTOCOL *Instance; > > + DHCP_SERVICE *DhcpSb; > > EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN *Token; > > EFI_UDP4_CONFIG_DATA UdpConfigData; > > IP4_ADDR ClientAddr; > > IP4_ADDR Ip; > > INTN Class; > > IP4_ADDR SubnetMask; > > > > Instance =3D (DHCP_PROTOCOL *) Context; > > + DhcpSb =3D Instance->Service; > > Token =3D Instance->Token; > > > > ZeroMem (&UdpConfigData, sizeof (EFI_UDP4_CONFIG_DATA)); > > > > UdpConfigData.AcceptBroadcast =3D TRUE; > > @@ -1206,14 +1208,19 @@ Dhcp4InstanceConfigUdpIo ( > > UdpConfigData.DoNotFragment =3D TRUE; > > > > ClientAddr =3D EFI_NTOHL (Token->Packet->Dhcp4.Header.ClientAddr); > > Ip =3D HTONL (ClientAddr); > > CopyMem (&UdpConfigData.StationAddress, &Ip, sizeof=20 > > (EFI_IPv4_ADDRESS)); > > - > > - Class =3D NetGetIpClass (ClientAddr); > > - ASSERT (Class < IP4_ADDR_CLASSE); > > - SubnetMask =3D gIp4AllMasks[Class << 3]; > > + > > + if (DhcpSb->Netmask =3D=3D 0) { > > + Class =3D NetGetIpClass (ClientAddr); > > + ASSERT (Class < IP4_ADDR_CLASSE); > > + SubnetMask =3D gIp4AllMasks[Class << 3]; } else { > > + SubnetMask =3D DhcpSb->Netmask; > > + } > > + > > Ip =3D HTONL (SubnetMask); > > CopyMem (&UdpConfigData.SubnetMask, &Ip, sizeof=20 > > (EFI_IPv4_ADDRESS)); > > > > if ((Token->ListenPointCount =3D=3D 0) ||=20 > > (Token->ListenPoints[0].ListenPort > > =3D=3D 0)) { > > UdpConfigData.StationPort =3D DHCP_CLIENT_PORT; @@ -1574,16 > > +1581,21 @@ EfiDhcp4TransmitReceive ( > > EndPoint.RemotePort =3D DHCP_SERVER_PORT; > > } else { > > EndPoint.RemotePort =3D Token->RemotePort; > > } > > > > + if (DhcpSb->Netmask =3D=3D 0) { > > + Class =3D NetGetIpClass (ClientAddr); > > + ASSERT (Class < IP4_ADDR_CLASSE); > > + SubnetMask =3D gIp4AllMasks[Class << 3]; } else { > > + SubnetMask =3D DhcpSb->Netmask; > > + } > > + > > // > > // Get the gateway. > > // > > - Class =3D NetGetIpClass (ClientAddr); > > - ASSERT (Class < IP4_ADDR_CLASSE); > > - SubnetMask =3D gIp4AllMasks[Class << 3]; > > ZeroMem (&Gateway, sizeof (Gateway)); > > if (!IP4_NET_EQUAL (ClientAddr, EndPoint.RemoteAddr.Addr[0], > > SubnetMask)) { > > CopyMem (&Gateway.v4, &Token->GatewayAddress, sizeof=20 > > (EFI_IPv4_ADDRESS)); > > Gateway.Addr[0] =3D NTOHL (Gateway.Addr[0]); > > } > > -- > > 1.9.5.msysgit.1 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel