Received: from list by lists.gnu.org with archive (Exim 4.71) id 1h1ujS-0001su-L6 for mharc-grub-devel@gnu.org; Thu, 07 Mar 2019 10:14:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1ujM-0001n8-Dw for grub-devel@gnu.org; Thu, 07 Mar 2019 10:14:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1ujL-0005G8-Ql for grub-devel@gnu.org; Thu, 07 Mar 2019 10:14:44 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:43506 helo=foss.arm.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1ujL-0005Fe-Jq for grub-devel@gnu.org; Thu, 07 Mar 2019 10:14:43 -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 CC4421684; Thu, 7 Mar 2019 07:14:42 -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 765F63F706; Thu, 7 Mar 2019 07:14:41 -0800 (PST) From: Andre Przywara To: Daniel Kiper Cc: Vladimir Serbinenko , Andrei Borzenkov , Daniel Kiper , Mark Rutland , grub-devel@gnu.org Subject: [PATCH v3 10/10] net: dhcp: add explicit net_dhcp command Date: Thu, 7 Mar 2019 15:14:16 +0000 Message-Id: <20190307151416.49014-11-andre.przywara@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190307151416.49014-1-andre.przywara@arm.com> References: <20190307151416.49014-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: Thu, 07 Mar 2019 15:14:49 -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 Reviewed-by: Daniel Kiper --- 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 63763aaab..04cfbb045 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -864,7 +864,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) @@ -872,6 +872,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.")); @@ -882,4 +885,5 @@ grub_bootp_fini (void) { grub_unregister_command (cmd_getdhcp); grub_unregister_command (cmd_bootp); + grub_unregister_command (cmd_dhcp); } -- 2.17.1