From: Punit Agrawal <punit.agrawal@arm.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: <mark.rutland@arm.com>, <matthew.t.rivard@intel.com>
Subject: Re: [PATCH v2] bootp: add native DHCPv4 support
Date: Wed, 27 Apr 2016 15:40:29 +0100 [thread overview]
Message-ID: <5720CF5D.9040309@arm.com> (raw)
In-Reply-To: <1458671180-15616-1-git-send-email-arvidjaar@gmail.com>
Hi Andrei,
Thanks for refreshing the patch. I was using a locally fixed up version
of your wip post from earlier in the year.
On 22/03/16 18:26, Andrei Borzenkov wrote:
> This patch adds support for native DHCPv4 and removes requirement for
> BOOTP compatibility support in DHCP server.
>
> There is no provision for selecting preferred server. We take the first
> OFFER and try to REQUEST configuration from it. If NAK was received,
> transaction is restarted, but if we hit timeout, configuration fails.
>
> It also handles pure BOOTP reply (detected by lack of DHCP message type
> option) and proceeds with configuration immedately. I could not test it
> because I do not have pure BOOTP server.
>
> Because we need access to DHCP options in multiple places now, it also
> factors out DHCP option processing, adding support for option overload.
>
> Timeout handling is now per-interface, with independent timeouts for
> both DISCOVER and REQUEST. It should make it more responsive if answer
> was delayed initially. Total timeout remains the same as originally, as
> well as backoff algorithm, but we poll in fixed 200ms ticks so notice
> (successful) reply earlier.
>
> Failure to send packet to interface now does not terminate command (and
> leaks memory) but rather simply ignores this interface and continues with
> remaining ones if present.
>
> Finally it adds net_dhcp alias with intention to deprecate net_bootp
> completely (it would be possible to make net_bootp to actually send BOOTP
> packet if someone thinks it is required).
>
The patch works for me on an arm64 board. With the patch, the board is
able to get an IP via DHCP and subsequently is able to load a kernel
image via tftp.
I haven't tested the bootp functionality as I don't have a DHCP server I
can control.
> Features not implements:
>
> - DHCP server selection. We take first DHCPOFFER or BOOTPREPLY. No plans
> to implement.
>
> - DHCP option concatenation (RFC3396). I do not expect to hit it in real
> life and it rather complicates implementation, so let's wait for actual
> use case.
>
> - client identifier (RFC6842). So far we expect valid MAC address, which
> should be enough to uniquely identify client. It is also not clear how to
> generate unique client identifier if we ever need one.
The unimplemented features don't seem to be an issue in my environment.
It would be great to see this functionality merged and working out of
the box.
Thanks for your efforts.
Punit
>
> v2: change find_dhcp_option to use subscripts to avoid signed/unsigned
> comparison warning.
>
> Should fix "may be used uninitialized" warning (although I could not
> reproduce it).
>
> ---
> grub-core/net/bootp.c | 759 ++++++++++++++++++++++++++++++++++----------------
> grub-core/net/ip.c | 2 +-
> include/grub/net.h | 14 +-
> 3 files changed, 528 insertions(+), 247 deletions(-)
>
[...]
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
next prev parent reply other threads:[~2016-04-27 16:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-20 7:29 [PATCH] bootp: add native DHCPv4 support Andrei Borzenkov
2016-03-22 18:26 ` [PATCH v2] " Andrei Borzenkov
2016-04-27 14:40 ` Punit Agrawal [this message]
2016-04-27 15:34 ` Mark Rutland
2016-11-17 19:06 ` Daniel Kiper
2016-11-18 17:51 ` Andrei Borzenkov
2016-11-22 9:22 ` 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=5720CF5D.9040309@arm.com \
--to=punit.agrawal@arm.com \
--cc=grub-devel@gnu.org \
--cc=mark.rutland@arm.com \
--cc=matthew.t.rivard@intel.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).