grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Daniel Kiper <dkiper@net-space.pl>, grub-devel@gnu.org
Cc: phcoder@gmail.com, nikunj@linux.vnet.ibm.com
Subject: Re: [2.02][PATCH] bootp: export server IP as environment variable
Date: Tue, 22 Nov 2016 20:21:12 +0300	[thread overview]
Message-ID: <b70793b8-8e4f-3ae6-a03c-9fefbd291f4d@gmail.com> (raw)
In-Reply-To: <20161121220205.GF22877@router-fw-old.local.net-space.pl>

22.11.2016 01:02, Daniel Kiper пишет:
> On Mon, Nov 21, 2016 at 10:52:24PM +0300, Andrei Borzenkov wrote:
>> 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_<interface>_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 <nikunj@linux.vnet.ibm.com>
>>>>>> 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 <arvidjaar@gmail.com>
>>>> 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_<interface>_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 <nikunj@linux.vnet.ibm.com>
>>>> 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{<interface>}_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{<interface>}_hostname::
>>>>  * net_@var{<interface>}_ip::
>>>>  * net_@var{<interface>}_mac::
>>>> +* net_@var{<interface>}_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{<interface>}_server" instead
>>> of "net_@var{<interface>}_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_<interface>_next_server for clarity, both "server"
>> and "server_ip" are indeed too vague in this case.
> 
> net_<interface>_next_server is OK for me. Should not we introduce
> net_default_next_server as RO then too? At first its value will be
> equal net_default_server but only net_default_server could be
> changed by user. Does it make sense?
> 

I would wait until someone has use case for it. I do not see it now.


  reply	other threads:[~2016-11-22 17:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 17:42 [2.02][PATCH] bootp: export server IP as environment variable Andrei Borzenkov
2016-11-17 19:02 ` Daniel Kiper
2016-11-18 18:11   ` Andrei Borzenkov
2016-11-21 13:09     ` Daniel Kiper
2016-11-21 19:52       ` Andrei Borzenkov
2016-11-21 22:02         ` Daniel Kiper
2016-11-22 17:21           ` Andrei Borzenkov [this message]
2016-11-22 18:19             ` Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b70793b8-8e4f-3ae6-a03c-9fefbd291f4d@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=phcoder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).