From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1c8udl-0000AP-Cj for mharc-grub-devel@gnu.org; Mon, 21 Nov 2016 14:52:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8udi-000071-BD for grub-devel@gnu.org; Mon, 21 Nov 2016 14:52:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8udf-0005uo-Np for grub-devel@gnu.org; Mon, 21 Nov 2016 14:52:30 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35612) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c8udf-0005uc-Gr for grub-devel@gnu.org; Mon, 21 Nov 2016 14:52:27 -0500 Received: by mail-wm0-x244.google.com with SMTP id a20so116102wme.2 for ; Mon, 21 Nov 2016 11:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=gtnpzFDxAKs3x+N0CqfLpXzL07P3qR5OdirdHN0JANQ=; b=egiCG5fQsCA1oQjorfJFoizJJ9WpW+JW5GTcQckWOYy5wlAxNPycIfvH4mwwoCrfBH HOFAKAiNvCcBFDjX1vn8veL5EFe++oA3rG0dZe81KgQ3fOC/ySbJBVEaD16SNcb055f4 SLhSjatHl0hSwOam9wvTsYAbTNlCf26zQhzdIHNg/2qpodMFDiOHOEHWvPHsex4QQ+yc f0nkFADSgpMdqlZYQRumB9AoMwzHe4nocVhCqYYj4CFMmMvojRnoj6Qz8Lib6EjxbeJO zbL22r6xxkl9Fccetnu8iYcpnsRtOBhi4954KxVZVNNTDuaL6XlzjQL9SntQIfClR/EN pyhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=gtnpzFDxAKs3x+N0CqfLpXzL07P3qR5OdirdHN0JANQ=; b=UzYvCQlKPjAyralO3QgKLOdcfeQR/36dOvZLIi5G8Olf7a+zl/vhi/twqiupDeNcGH 28AuPpS9BdIQ0ZhWDn7jsATk5Vg2UZpnieHkKhgrTLuiaO1AT1TPApumAI1gFgH/NaDj Pzq2nMuv1IpgA+0dUtbeBkRIQGcjs8YbKM2GclavlBDxiSUrbkcLsHCfimTiWVi5ZSxL dAbBwWhRvSqvvO9hjMwoy773t/2M2rLKJmIvbLE7o0l4StqeMCE0WLfqSCpxRFQ8e4Ys C5RWDCmxVk4eTNLhDIqYk4lPf0OCKOlQ3gzWd/kRcu0sEUio2xJkdmihXiLPfc1eTq1i FQ3g== X-Gm-Message-State: AKaTC03vJOs0ueDgeQHK4frxrD7kh7YUZPL3rtJWrPRl+eEw7DEPPIsYRrlwQG/GnE1mGA== X-Received: by 10.25.161.138 with SMTP id k132mr4022273lfe.102.1479757945988; Mon, 21 Nov 2016 11:52:25 -0800 (PST) Received: from [192.168.1.44] (ppp109-252-90-55.pppoe.spdop.ru. [109.252.90.55]) by smtp.gmail.com with ESMTPSA id m81sm5577516lfd.45.2016.11.21.11.52.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Nov 2016 11:52:25 -0800 (PST) Subject: Re: [2.02][PATCH] bootp: export server IP as environment variable To: Daniel Kiper , grub-devel@gnu.org 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> <20161121130948.GA22877@router-fw-old.local.net-space.pl> Cc: phcoder@gmail.com, nikunj@linux.vnet.ibm.com From: Andrei Borzenkov Message-ID: <96d20900-fb5a-189b-d01b-c8cd041f248b@gmail.com> Date: Mon, 21 Nov 2016 22:52:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161121130948.GA22877@router-fw-old.local.net-space.pl> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::244 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 19:52:31 -0000 21.11.2016 16:09, Daniel Kiper пишет: > 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... > Yes. Sorry, it was probably my fault to refer to DHCP in the first place. >> +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. > Well, net_default_server is not really tied to any BOOTP/DHCP at all, although it may be initially set based on content of ACK packet. I was confused by dhcp_server_name, but they it is unrelated to next server. I'd rather used net__next_server for clarity, both "server" and "server_ip" are indeed too vague in this case. > Otherwise LGTM. > > Daniel >