[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 9/9] net: dhcp: add explicit net_dhcp command
From: |
Andre Przywara |
Subject: |
[PATCH v2 9/9] net: dhcp: add explicit net_dhcp command |
Date: |
Tue, 12 Feb 2019 17:47:00 +0000 |
From: Andrei Borzenkov <address@hidden>
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 <address@hidden>
---
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
- [PATCH v2 4/9] net: dhcp: make grub_net_process_dhcp take an interface, (continued)
- [PATCH v2 4/9] net: dhcp: make grub_net_process_dhcp take an interface, Andre Przywara, 2019/02/12
- [PATCH v2 5/9] net: dhcp: introduce per-interface timeout, Andre Przywara, 2019/02/12
- [PATCH v2 6/9] net: dhcp: use DHCP options for name and bootfile, Andre Przywara, 2019/02/12
- [PATCH v2 8/9] net: dhcp: actually send out DHCPv4 DISCOVER and REQUEST messages, Andre Przywara, 2019/02/12
- [PATCH v2 7/9] net: dhcp: allow receiving DHCP OFFER and ACK packets, Andre Przywara, 2019/02/12
- [PATCH v2 9/9] net: dhcp: add explicit net_dhcp command,
Andre Przywara <=