Received: from list by lists.gnu.org with archive (Exim 4.71) id 1c8oP7-0001EZ-NF for mharc-grub-devel@gnu.org; Mon, 21 Nov 2016 08:13:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8oP5-0001EH-87 for grub-devel@gnu.org; Mon, 21 Nov 2016 08:13:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8oP1-0003Re-7s for grub-devel@gnu.org; Mon, 21 Nov 2016 08:12:59 -0500 Received: from boksu.net-space.pl ([185.15.1.105]:49239) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.71) (envelope-from ) id 1c8oP0-0003Qv-Sw for grub-devel@gnu.org; Mon, 21 Nov 2016 08:12:55 -0500 Received: (from localhost user: 'dkiper' uid#4000 fake: STDIN (dkiper@boksu.net-space.pl)) by router-fw-old.local.net-space.pl id S1671694AbcKUNJs (ORCPT ); Mon, 21 Nov 2016 14:09:48 +0100 Date: Mon, 21 Nov 2016 14:09:48 +0100 From: Daniel Kiper To: arvidjaar@gmail.com, grub-devel@gnu.org Cc: dkiper@net-space.pl, phcoder@gmail.com, nikunj@linux.vnet.ibm.com Subject: Re: [2.02][PATCH] bootp: export server IP as environment variable Message-ID: <20161121130948.GA22877@router-fw-old.local.net-space.pl> References: <1458322920-5131-1-git-send-email-arvidjaar@gmail.com> <20161117190234.GA7245@router-fw-old.local.net-space.pl> <8dcbe77f-6075-b4dc-933f-6b7a30be3742@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8dcbe77f-6075-b4dc-933f-6b7a30be3742@gmail.com> User-Agent: Mutt/1.3.28i X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 185.15.1.105 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2016 13:13:00 -0000 On Fri, Nov 18, 2016 at 09:11:47PM +0300, Andrei Borzenkov wrote: > 17.11.2016 22:02, Daniel Kiper ??????????: > > On Fri, Mar 18, 2016 at 08:42:00PM +0300, Andrei Borzenkov wrote: > >> Network boot autoconfiguration sets default server to next server IP > >> (siaddr) from BOOTP/DHCP reply, but manual configuration using net_bootp > >> exports only server name. Unfortunately semantic of server name is not > >> clearly defined. BOOTP RFC 951 defines it only for client request, and > >> DHCP RFC 1541 only mentions it, without any implied usage. It looks like > >> this field is mostly empty in server replies. > >> > >> Export next server IP as net__server_ip variable. This allows > >> grub configuration script to set $root/$prefix based on information obtained > >> by net_bootp. > >> > >> Reported and tested by: Nikunj A Dadhania > >> Cc: nikunj@linux.vnet.ibm.com > >> > >> --- > >> > >> @Nikunj: cosmetic changes comparing with version you tested - no need to > >> allocate small buffer dynamically. > >> > >> @Vladimir: I think this is useful; I will update networking documentation > >> in followup patch. > > > > Vladimir, Andrei, could you take care of it? > > > > Daniel > > > > I added documentation (not worth separate patch); if there are no > objections I commit. > > > From: Andrei Borzenkov > Subject: [2.02][PATCH] bootp: export server IP as environment variable > > Network boot autoconfiguration sets default server to next server IP > (siaddr) from BOOTP/DHCP reply, but manual configuration using net_bootp > exports only server name. Unfortunately semantic of server name is not > clearly defined. BOOTP RFC 951 defines it only for client request, and > DHCP RFC 1541 only mentions it, without any implied usage. It looks like > this field is mostly empty in server replies. > > Export next server IP as net__server_ip variable. This allows > grub configuration script to set $root/$prefix based on information obtained > by net_bootp. > > Reported and tested by: Nikunj A Dadhania > Cc: nikunj@linux.vnet.ibm.com > > --- > docs/grub.texi | 11 +++++++++++ > grub-core/net/bootp.c | 24 ++++++++++++++---------- > 2 files changed, 25 insertions(+), 10 deletions(-) > > diff --git a/docs/grub.texi b/docs/grub.texi > index 82f6fa4..bb03875 100644 > --- a/docs/grub.texi > +++ b/docs/grub.texi > @@ -2446,6 +2446,10 @@ The boot file name provided by DHCP. Read-only. > The name of the DHCP server responsible for these boot parameters. > Read-only. > > +@item net_@var{}_server_ip > +The IP address of the next (usually, TFTP) server provided by DHCP. BOOTP instead of DHCP? However, then we should change DHCP everywhere too... > +Read-only. > + > @item net_default_interface > Initially set to name of network interface that was used to load grub. > Read-write, although setting it affects only interpretation of > @@ -3062,6 +3066,7 @@ These variables have special meaning to GRUB. > * net_@var{}_hostname:: > * net_@var{}_ip:: > * net_@var{}_mac:: > +* net_@var{}_server_ip:: There is something known as net_default_server which contains next IP address. Should not we be more consistent and use "net_@var{}_server" instead of "net_@var{}_server_ip" here and there. Otherwise LGTM. Daniel