From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aMKEI-0000ng-D9 for mharc-grub-devel@gnu.org; Thu, 21 Jan 2016 13:45:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMKEE-0000iV-UA for grub-devel@gnu.org; Thu, 21 Jan 2016 13:45:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMKEB-0004r4-ON for grub-devel@gnu.org; Thu, 21 Jan 2016 13:45:06 -0500 Received: from foss.arm.com ([217.140.101.70]:51286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMKEB-0004pW-HC for grub-devel@gnu.org; Thu, 21 Jan 2016 13:45:03 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5D6D73A8; Thu, 21 Jan 2016 10:37:21 -0800 (PST) Received: from leverpostej (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CBBAE3F529; Thu, 21 Jan 2016 10:37:59 -0800 (PST) Date: Thu, 21 Jan 2016 18:37:37 +0000 From: Mark Rutland To: The development of GNU GRUB Subject: Re: [PATCH][WiP] native DHCPv4 support in net_bootp Message-ID: <20160121183737.GI2581@leverpostej> References: <55FB8A5F.6040404@gmail.com> <561DF29D.70702@gmail.com> <561E990D.90205@gmail.com> <561EB696.5070909@gmail.com> <569BB641.4040609@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <569BB641.4040609@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.140.101.70 Cc: "Rivard, Matthew T" X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 18:45:08 -0000 Hi, Thank you for putting this together! On Sun, Jan 17, 2016 at 06:41:53PM +0300, Andrei Borzenkov wrote: > 14.10.2015 23:09, Andrei Borzenkov =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > 14.10.2015 21:09, Rivard, Matthew T =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > >> Just going by these definitions of bootp and dhcp here: > >> https://technet.microsoft.com/en-us/library/cc781243%28v=3Dws.10%29.= aspx > >> > >> The net_bootp only works with a bootp enabled scope on the dhcp serv= er > >> after chaining from iPXE to grub2. Without a "bootp" scope setup o= n > >> the dhcp, calling net_bootp on the adapter fails to get an IP addres= s. > >> > >> So, I guess I could more clearly word that the bootp protocol works > >> when calling net_bootp, but standard dhcp isn't. > >> > >=20 > > Hmm ... you are right; we are actually doing BOOTP here, not DHCP. > >=20 >=20 > This patch adds support for native DHCPv4 and removes requirement for > BOOTP compatibility support in DHCP server. >=20 > This is work in progress, but this works for me in test environment. I haven't delved into the code, but FWIW, this also works for me in my BOOTP-free work environment on an AArch64 host: grub> insmod efinet grub> net_ls_cards efinet1 00:00:1a:1b:9d:9a efinet0 00:00:1a:1b:9d:99 grub> net_bootp efinet0 grub> insmod tftp grub> set net_default_server=3D10.1.205.151 grub> linux (tftp)/Image grub> boot EFI stub: Booting Linux Kernel... EFI stub: Using DTB from configuration table EFI stub: Exiting boot services and installing virtual address map... Booting Linux on physical CPU 0x0 Initializing cgroup subsys cpu Linux version 4.4.0-rc3+ (mark@leverpostej) (gcc version 5.1.1 20150608 (= Linaro GCC 5.1-2015.08) ) #63 SMP PREEMPT Mon Jan 18 10:20:30 GMT 2016 .... I have not tested BOOTP as I do not have a BOOTP server to hand. I'd like to be able to net-boot a number of development machines that I a= m in charge of. However, as I'm not in charge of the network I cannot use PXE,= and our DHCP servers do not implement BOOTP. Having DHCP support would be incredibly useful for being able to net-boot boards in a standard manner while not having full control over the networ= k. > Patch changes net_bootp to implement full DHCP transaction. it still > /should/ work with BOOTP pure server (untested, I do not have one). It > also re-implements option processing to support overloaded fields and > consolidates it in one place. >=20 > What is currently not implemented >=20 > - per interface, per transaction stage retransmit timer. Will be done. >=20 > - DHCP server selection. We take first DHCPOFFER or BOOTPREPLY. No plan= s > to implement. >=20 > - DHCP option concatenation (RFC3396). I do not expect to hit it in rea= l > life; could be implemented relatively easy if needed. >=20 > - client identifier (RFC6842). I do not expect to hit it in real life; > could be added easily if needed. The above sounds fine for my purposes. Thanks, Mark.