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 A9B061A1E3C for ; Mon, 17 Oct 2016 23:44:50 -0700 (PDT) Received: from IMSVA.IN.MEGATRENDS.COM (IMSVA.IN.MEGATRENDS.COM [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ECD0E82047; Tue, 18 Oct 2016 12:15:18 +0530 (IST) Received: from IMSVA.IN.MEGATRENDS.COM (IMSVA.IN.MEGATRENDS.COM [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CBB5182046; Tue, 18 Oct 2016 12:15:18 +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, 18 Oct 2016 12:15:18 +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, 18 Oct 2016 12:15:14 +0530 From: Santhapur Naveen To: "Fu, Siyuan" , "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Li, Ruth" Thread-Topic: [edk2] [Patch] MdeModulePkg: Support classless IP for DHCPv4 TransmitReceive() Thread-Index: AQHR+RLwIH+7Fl9w206WgrYfZrCIQqBN2AGAgABcjqCAF5ss8IBCDjtggAWnEwCAAIPXMA== Date: Tue, 18 Oct 2016 06:44:54 +0000 Message-ID: <625A2455CC232F40B0F38F05ACED6D978C2F81E8@VENUS1.in.megatrends.com> References: <1471498722-36656-1-git-send-email-jiaxin.wu@intel.com> <895558F6EA4E3B41AC93A00D163B7274137C87CB@SHSMSX103.ccr.corp.intel.com> <625A2455CC232F40B0F38F05ACED6D978C2F7B64@VENUS1.in.megatrends.com> In-Reply-To: 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-22644.005 X-TM-AS-Result: No--41.669-5.0-31-10 X-imss-scan-details: No--41.669-5.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1600-8.1.1054-22644.005 X-TMASE-Result: 10--41.668900-10.000000 X-TMASE-MatchedRID: IeZYkn8zfFqnykMun0J1wuG5dRZCgxC3I6QKWhRGE3NTYyyCA5vjwJTw dOQY9cnVfBwbzAtwSRilQCjOrjS/qdvadCKgTaGciUPZPmKZOQllrsuS5tC+P+oWVODXAWfcJMJ XDJjkqdSHlULG8tlGLihInVcxeKKhHjJchJT3ghhx+x1f5juFE9SqEluSYtV7MKZRiezcUtNZWo QnlcYq7T2XPP5womilqHYh8HRcRTY7UWHrkqOW/9saYZjO7kKDKx5ICGp/WtFh2lxkfcGsFOE4l FHRU1A7j9J0WFxmO0SzEc8U4fu4tYzT6TNxAeL3HcQQBuf4ZFvJ5SXtoJPLyMePnpCvI67rAVrm NdzfBZ5QwNTKteW8hlIvgRLeq614iNCj8jDazVLM1jffIgQXhucUOFeb+PcjW4Hki0u6vIROCnN Y9CkMJZGmc0sFnSbmRLk+5yyLtivCbh0vUSZmuZ1v5WrnSRXht3aeg7g/usDfc2Xd6VJ+yotXSV 7OEx9lGXVOModIZ6b6uiZyo4QnOgwcdlQ73YpDws9cphnKwlEIQFYdJrnSuSS8BoUIaJ6UREYj3 tnff37mN0kr+p6lBAewcPcweqB2pqOcrgesqg9NVr4vdmCpzl+U6kGoEdO3zO86RLKahv8nwf3k fmsrQ3e1e/eza3FIQVYK+bzrDzjSxemNC+0f0BuurbgYp+HQ6r+5bPPauHf5N0o2THGRZKgFX2x z5NjH4j4lr4Wn4RisEFKef8ZUxpcqz3g0A4fyupDIC9422DozH3zWWApNw6UXswX/xrIS2s92sh 0zjZvZfQx3B5aMuJJTzjwz+GzorhAB5C8gZ6qeAiCmPx4NwGmRqNBHmBvepvI8UZOf47ilpfSTJ RNTL6ebHCxzBV4TOwBXM346/+xQgr8qmZAN7iPJ+/ArMp5tLtjBIDt785pm+BURtFmbVzX615/Z QzU6 X-TMASE-SNAP-Result: 1.811037.0001-0-1-12:0,22:0,33:0,34:0,39:0-0 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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, 18 Oct 2016 06:44:51 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Fu Siyuan, Thanks for the update. I had reported a bug in the Bugzilla site. Please use the link https://bugz= illa.tianocore.org/show_bug.cgi?id=3D155 to view the details. Please let me know if any other details are needed. Thank you, Naveen From: Fu, Siyuan [mailto:siyuan.fu@intel.com] Sent: Tuesday, October 18, 2016 8:16 AM To: Santhapur Naveen; Wu, Jiaxin; edk2-devel@lists.01.org Cc: Ye, Ting; Li, Ruth Subject: RE: [edk2] [Patch] MdeModulePkg: Support classless IP for DHCPv4 T= ransmitReceive() Hi, Naveen I checked the code and found the IP4 stack is actually doesn't support clas= sless IP address now, the main reason is in the NetLib interface NetGetIpCl= ass() and NetIp4IsUnicast(). These 2 interfaces do not consider the netmask= so it won't recognize a classless IP configuration. Almost all other netwo= rk drivers (IP4, ARP, iSCSI, Mtftp, PXE, TCP, UDP) are using these 2 interf= aces so I guess they may have the same problem. Please help to submit a ticket in tianocore Bugzilla for this issue, thanks= . BestRegards Fu Siyuan From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Sant= hapur Naveen Sent: Friday, October 14, 2016 3:19 PM To: Wu, Jiaxin >; edk2-deve= l@lists.01.org Cc: Ye, Ting >; Fu, Siyuan > Subject: Re: [edk2] [Patch] MdeModulePkg: Support classless IP for DHCPv4 T= ransmitReceive() Hello Jiaxin, We've run into one more problem with PXE boot. The PXE boot is not happen= ing when the server tries to assign an IP address whose last octet is zero. The below is my configuration: [Server Configuration] Ipv4 address : 192.168.0.1/16 Netmask: 255.255.0.0 DHCPv4 Scope: Range: 192.168.0.2 to 192.168.10.10 Netmask: 255.255.0.0 I've observed that in the given address range, if the server tries to all= ocate any IP address with the last octet as 0 i.e., for instance 192.168.A.= 0 where A vary from 1 to 10, then the PXE boot fails saying "PXE-E09: Could= not allocate I/O buffers." I agree that the x.y.z.0 and x.y.z.255 are network address any can't be a= ssigned based on the subnet (In this case, 192.168.0.0 and 192.168.255.255)= . But here, the Netmask is different which expects the IP address x.y.a.0 w= hich is within the range is valid and can be assigned to any client in the = network. I captured Wireshark log and as per it, the D.O.R.A process is finished b= ut the client is sending a Decline packet. I suspect the function NetIp4IsU= nicast() has a role to play in this. Please provide your comments on this. Best regards, Naveen -----Original Message----- From: Santhapur Naveen Sent: Friday, September 02, 2016 11:46 AM To: 'Wu, Jiaxin'; 'edk2-devel@lists.01.org' Cc: 'Ye, Ting'; 'Fu, Siyuan' Subject: RE: [edk2] [Patch] MdeModulePkg: Support classless IP for DHCPv4 T= ransmitReceive() Hello Jiaxin, My sincere apologies for the delayed response. I've verified the patch from my side and PXE boot is happening successful= ly even in classless IP network. May I know whether this will be included in EDK2? If yes, can you please = provide any schedule for the same? Best regards, Naveen -----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 DHCPv4 T= ransmitReceive() Jiaxin, We will verify the patch and update you the result. Thanks, Naveen -----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 DHCPv4 T= ransmitReceive() Naveen, Can you help to verify this patch to support the classless IP. Thanks, Jiaxin > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Jiaxin Wu > Sent: Thursday, August 18, 2016 1:39 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting >; Fu, Siyuan >; > Santhapur Naveen > > Subject: [edk2] [Patch] MdeModulePkg: Support classless IP for DHCPv4 > TransmitReceive() > > The IP address should not be treated as classful one if DHCP options > contain a classless IP with its true subnet mask. Otherwise, DHCPv4 > TransmitReceive() will failed. This real subnet mask will be parsed > and recorded in DhcpSb->Netmask. So, we need check it before get the > 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 > reserved.
> +Copyright (c) 2006 - 2016, Intel Corporation. All rights > +reserved.
> This program and the accompanying materials are licensed and made > available under the terms and conditions of the BSD License which > accompanies this distribution. The full text of the license may be > 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 > (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 > (EFI_IPv4_ADDRESS)); > > if ((Token->ListenPointCount =3D=3D 0) || > (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 > (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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel