Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gtcA1-0002xn-CX for mharc-grub-devel@gnu.org; Tue, 12 Feb 2019 12:47:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtc9x-0002tR-1b for grub-devel@gnu.org; Tue, 12 Feb 2019 12:47:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtc9q-0003IJ-Qo for grub-devel@gnu.org; Tue, 12 Feb 2019 12:47:50 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37702 helo=foss.arm.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtc9h-0002wa-BO for grub-devel@gnu.org; Tue, 12 Feb 2019 12:47:38 -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 62E55165C; Tue, 12 Feb 2019 09:47:22 -0800 (PST) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.197.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0CF0F3F675; Tue, 12 Feb 2019 09:47:20 -0800 (PST) From: Andre Przywara To: Daniel Kiper Cc: Vladimir Serbinenko , Andrei Borzenkov , Daniel Kiper , Mark Rutland , grub-devel@gnu.org Subject: [PATCH v2 9/9] net: dhcp: add explicit net_dhcp command Date: Tue, 12 Feb 2019 17:47:00 +0000 Message-Id: <20190212174700.184741-10-andre.przywara@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190212174700.184741-1-andre.przywara@arm.com> References: <20190212174700.184741-1-andre.przywara@arm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.140.101.70 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: Tue, 12 Feb 2019 17:47:54 -0000 From: Andrei Borzenkov Mostly for cosmetic reasons, we add a "net_dhcp" command, which is (at the moment) identical to the existing "net_bootp" command. Both actually trigger a DHCP handshake now, and both should be able to deal with pure BOOTP servers. We could think about dropping the DHCP options from the initial DISCOVER packet when the user issues the net_bootp command, but it's unclear whether this is really useful, as both protocols should be able to coexist. Signed-off-by: Andre Przywara --- grub-core/net/bootp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c index 4b20b1799..5584d0da3 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -866,7 +866,7 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), return err; } -static grub_command_t cmd_getdhcp, cmd_bootp; +static grub_command_t cmd_getdhcp, cmd_bootp, cmd_dhcp; void grub_bootp_init (void) @@ -874,6 +874,9 @@ grub_bootp_init (void) cmd_bootp = grub_register_command ("net_bootp", grub_cmd_bootp, N_("[CARD]"), N_("perform a bootp autoconfiguration")); + cmd_dhcp = grub_register_command ("net_dhcp", grub_cmd_bootp, + N_("[CARD]"), + N_("perform a DHCP autoconfiguration")); cmd_getdhcp = grub_register_command ("net_get_dhcp_option", grub_cmd_dhcpopt, N_("VAR INTERFACE NUMBER DESCRIPTION"), N_("retrieve DHCP option and save it into VAR. If VAR is - then print the value.")); @@ -884,4 +887,5 @@ grub_bootp_fini (void) { grub_unregister_command (cmd_getdhcp); grub_unregister_command (cmd_bootp); + grub_unregister_command (cmd_dhcp); } -- 2.17.1